├── docs └── html │ ├── bc_s.png │ ├── bc_sd.png │ ├── closed.png │ ├── nav_f.png │ ├── nav_fd.png │ ├── nav_g.png │ ├── nav_h.png │ ├── nav_hd.png │ ├── open.png │ ├── tab_a.png │ ├── tab_ad.png │ ├── tab_b.png │ ├── tab_bd.png │ ├── tab_h.png │ ├── tab_hd.png │ ├── tab_s.png │ ├── tab_sd.png │ ├── splitbar.png │ ├── sync_off.png │ ├── sync_on.png │ ├── splitbard.png │ ├── search │ ├── pages_1.js │ ├── all_a.js │ ├── all_e.js │ ├── pages_0.js │ ├── all_4.js │ ├── all_6.js │ ├── pages_2.js │ ├── all_8.js │ ├── files_0.js │ ├── files_1.js │ ├── all_9.js │ ├── all_f.js │ ├── all_2.js │ ├── all_d.js │ ├── variables_2.js │ ├── typedefs_0.js │ ├── functions_1.js │ ├── variables_4.js │ ├── all_1.js │ ├── classes_0.js │ ├── all_5.js │ ├── variables_6.js │ ├── all_3.js │ ├── all_7.js │ ├── variables_3.js │ ├── all_0.js │ ├── all_c.js │ ├── variables_5.js │ ├── variables_1.js │ ├── searchdata.js │ ├── defines_0.js │ ├── defines_1.js │ ├── variables_0.js │ ├── functions_0.js │ ├── mag.svg │ ├── mag_d.svg │ ├── close.svg │ ├── mag_sel.svg │ ├── mag_seld.svg │ ├── all_b.js │ ├── functions_2.js │ └── all_10.js │ ├── minus.svg │ ├── minusd.svg │ ├── plus.svg │ ├── plusd.svg │ ├── doc.svg │ ├── docd.svg │ ├── menudata.js │ ├── folderclosed.svg │ ├── folderclosedd.svg │ ├── cookie.js │ ├── doxygen_crawl.html │ ├── navtree.css │ ├── folderopend.svg │ ├── clipboard.js │ ├── folderopen.svg │ ├── _r_e_a_d_m_e_8md.html │ ├── globals_type.html │ ├── classes.html │ ├── files.html │ ├── globals_defs.html │ ├── globals_vars.html │ ├── globals_func.html │ ├── annotated.html │ ├── structxmem__pool__block-members.html │ ├── globals.html │ ├── functions.html │ ├── functions_vars.html │ ├── structxmem__pool-members.html │ ├── resize.js │ └── menu.js ├── perf_test ├── tools └── cpplint │ ├── samples │ ├── v8-sample │ │ ├── README.md │ │ ├── simple.def │ │ └── LICENSE │ ├── boost-sample │ │ ├── README.md │ │ ├── LICENSE │ │ ├── src │ │ │ ├── inspect │ │ │ │ └── unnamed_namespace_check.hpp │ │ │ └── tr1 │ │ │ │ └── c_policy.hpp │ │ └── headers_inspect.def │ ├── vlc-sample │ │ └── README.md │ ├── chromium-sample │ │ ├── README.md │ │ └── simple.def │ ├── protobuf-sample │ │ ├── README.md │ │ └── LICENSE │ ├── codelite-sample │ │ ├── README.md │ │ └── src │ │ │ └── pptable.h │ └── silly-sample │ │ └── filters.def │ ├── .style.yapf │ ├── dev-requirements │ ├── test-requirements │ ├── setup.cfg │ ├── tox.ini │ ├── .travis.yml │ ├── MANIFEST.in │ ├── .pylintrc │ ├── .flake8 │ ├── LICENSE │ ├── .gitignore │ ├── README.rst │ ├── setup.py │ └── changelog.rst ├── .cpplint ├── CPPLINT.cfg ├── .eslintrc ├── .editorconfig ├── .gitignore ├── package.json ├── perf ├── common.h ├── alloc.c ├── report │ ├── macbook-m1.json │ ├── huaban-dev.json │ ├── vps.json │ ├── zanarblahblah.json │ └── macbook-air.json ├── xmem.c └── rdtsc.h ├── LICENSE ├── test.c ├── Doxyfile ├── perf.js ├── README.md ├── Makefile ├── .clang-format └── xmempool.h /docs/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/bc_s.png -------------------------------------------------------------------------------- /docs/html/bc_sd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/bc_sd.png -------------------------------------------------------------------------------- /docs/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/closed.png -------------------------------------------------------------------------------- /docs/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/nav_f.png -------------------------------------------------------------------------------- /docs/html/nav_fd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/nav_fd.png -------------------------------------------------------------------------------- /docs/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/nav_g.png -------------------------------------------------------------------------------- /docs/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/nav_h.png -------------------------------------------------------------------------------- /docs/html/nav_hd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/nav_hd.png -------------------------------------------------------------------------------- /docs/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/open.png -------------------------------------------------------------------------------- /docs/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/tab_a.png -------------------------------------------------------------------------------- /docs/html/tab_ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/tab_ad.png -------------------------------------------------------------------------------- /docs/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/tab_b.png -------------------------------------------------------------------------------- /docs/html/tab_bd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/tab_bd.png -------------------------------------------------------------------------------- /docs/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/tab_h.png -------------------------------------------------------------------------------- /docs/html/tab_hd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/tab_hd.png -------------------------------------------------------------------------------- /docs/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/tab_s.png -------------------------------------------------------------------------------- /docs/html/tab_sd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/tab_sd.png -------------------------------------------------------------------------------- /docs/html/splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/splitbar.png -------------------------------------------------------------------------------- /docs/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/sync_off.png -------------------------------------------------------------------------------- /docs/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/sync_on.png -------------------------------------------------------------------------------- /docs/html/splitbard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XadillaX/xmempool/HEAD/docs/html/splitbard.png -------------------------------------------------------------------------------- /perf_test: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | make perf_xmem && make perf_alloc 3 | ./perf_xmem && ./perf_alloc 4 | -------------------------------------------------------------------------------- /docs/html/search/pages_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['pool_0',['X Memo Pool',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['usage_0',['Usage',['../index.html#autotoc_md3',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_e.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['usage_0',['Usage',['../index.html#autotoc_md1',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/pages_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['memo_20pool_0',['X Memo Pool',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['license_0',['License',['../index.html#autotoc_md11',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['overview_0',['Overview',['../index.html#autotoc_md1',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/pages_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['x_20memo_20pool_0',['X Memo Pool',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['readme_2emd_0',['README.md',['../_r_e_a_d_m_e_8md.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/files_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['readme_2emd_0',['README.md',['../_r_e_a_d_m_e_8md.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/files_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['xmempool_2eh_0',['xmempool.h',['../xmempool_8h.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /tools/cpplint/samples/v8-sample/README.md: -------------------------------------------------------------------------------- 1 | # V8 sample 2 | 3 | code taken for regression testing from https://github.com/v8/v8 4 | -------------------------------------------------------------------------------- /tools/cpplint/samples/boost-sample/README.md: -------------------------------------------------------------------------------- 1 | # VLC sample 2 | 3 | code taken for regression testing from https://github.com/boostorg 4 | -------------------------------------------------------------------------------- /docs/html/search/all_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['the_20pool_0',['Destroying the Pool',['../index.html#autotoc_md7',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /tools/cpplint/samples/vlc-sample/README.md: -------------------------------------------------------------------------------- 1 | # VLC sample 2 | 3 | code taken for regression testing from https://github.com/videolan/vlc 4 | -------------------------------------------------------------------------------- /docs/html/search/all_f.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['whole_20pool_0',['Destroy the Whole Pool',['../index.html#autotoc_md5',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['destroying_20the_20pool_0',['Destroying the Pool',['../index.html#autotoc_md7',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['the_20whole_20pool_0',['Destroy the Whole Pool',['../index.html#autotoc_md5',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /tools/cpplint/samples/chromium-sample/README.md: -------------------------------------------------------------------------------- 1 | # VLC sample 2 | 3 | code taken for regression testing from https://github.com/chromium/chromium 4 | -------------------------------------------------------------------------------- /tools/cpplint/samples/protobuf-sample/README.md: -------------------------------------------------------------------------------- 1 | # VLC sample 2 | 3 | code taken for regression testing from https://github.com/protocolbuffers/protobuf 4 | -------------------------------------------------------------------------------- /.cpplint: -------------------------------------------------------------------------------- 1 | set noparent 2 | filter=-build/include_alpha,-build/include_subdir,-build/include_what_you_use,-legal/copyright,-readability/nolint 3 | linelength=80 4 | -------------------------------------------------------------------------------- /docs/html/search/variables_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['end_0',['end',['../structxmem__pool.html#aea3ab4393ae4b652f106b866e76fff06',1,'xmem_pool']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /tools/cpplint/.style.yapf: -------------------------------------------------------------------------------- 1 | [style] 2 | based_on_style = chromium 3 | dedent_closing_brackets = True 4 | coalesce_brackets = True 5 | continuation_indent_width = 2 6 | -------------------------------------------------------------------------------- /tools/cpplint/samples/codelite-sample/README.md: -------------------------------------------------------------------------------- 1 | Canary sample taken from codelite https://github.com/eranif/codelite 2 | License applies as per LICENSE file in this folder 3 | -------------------------------------------------------------------------------- /CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | set noparent 2 | filter=-build/include_alpha,-build/include_subdir,-build/include_what_you_use,-legal/copyright,-readability/nolint,-readability/casting 3 | linelength=80 4 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "eslint-config-egg" 4 | ], 5 | "rules": { 6 | "max-len": [ 7 | "error", 8 | { "code": 80 } 9 | ] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/html/search/typedefs_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['xmem_5fpool_5fhandle_0',['xmem_pool_handle',['../xmempool_8h.html#a3fce2e8b5d5306b76afb7870c053a664',1,'xmempool.h']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/functions_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['size_5fcount_5fwith_5f4_0',['size_count_with_4',['../xmempool_8c.html#a017124d3c7e4814c6502796b39509722',1,'xmempool.c']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/variables_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['is_5fblock_5fstart_0',['is_block_start',['../structxmem__pool__block.html#ac4ac1808fc99088927d53c5379d6aeb4',1,'xmem_pool_block']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/html/search/all_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['contributing_0',['Contributing',['../index.html#autotoc_md10',1,'']]], 4 | ['creating_20a_20pool_1',['Creating a Pool',['../index.html#autotoc_md4',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/html/search/classes_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['xmem_5fpool_0',['xmem_pool',['../structxmem__pool.html',1,'']]], 4 | ['xmem_5fpool_5fblock_1',['xmem_pool_block',['../structxmem__pool__block.html',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/html/search/all_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['memo_20pool_0',['X Memo Pool',['../index.html',1,'']]], 4 | ['memory_1',['Memory',['../index.html#autotoc_md5',1,'Allocating Memory'],['../index.html#autotoc_md6',1,'Freeing Memory']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 2 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [Makefile] 12 | indent_size = 8 13 | indent_style = tab 14 | -------------------------------------------------------------------------------- /docs/html/search/variables_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['start_0',['start',['../structxmem__pool__block.html#ac5d567af757e520ea648f80f87a3e062',1,'xmem_pool_block::start'],['../structxmem__pool.html#a12120dc7808ef4f91d861eae6f6d29f1',1,'xmem_pool::start']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /tools/cpplint/dev-requirements: -------------------------------------------------------------------------------- 1 | # requirements to run development steps 2 | 3 | # also change in tox.ini 4 | flake8>=3.7.8 5 | pylint>=1.8.4 6 | tox>=3.0.0 7 | tox-pyenv 8 | 9 | # Below only run with python3, installed in tox.ini 10 | # mypy 11 | # coala 12 | # coala-bears 13 | -------------------------------------------------------------------------------- /tools/cpplint/test-requirements: -------------------------------------------------------------------------------- 1 | # minimal requirements to run python setup.py test 2 | # 5.x requires python 3.5 3 | pytest>=4.6,<5.0 4 | pytest-cov 5 | # freeze versions breaking python 2.7 on travis 6 | pyparsing<3 7 | zipp<=0.5.1 8 | configparser<=3.7.4 9 | testfixtures 10 | -------------------------------------------------------------------------------- /docs/html/search/all_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['features_0',['Features',['../index.html#autotoc_md2',1,'']]], 4 | ['freeing_20memory_1',['Freeing Memory',['../index.html#autotoc_md6',1,'']]], 5 | ['functions_2',['Additional Functions',['../index.html#autotoc_md8',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/html/search/all_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['performance_0',['Performance',['../index.html#autotoc_md9',1,'']]], 4 | ['pool_1',['Pool',['../index.html#autotoc_md4',1,'Creating a Pool'],['../index.html#autotoc_md7',1,'Destroying the Pool'],['../index.html',1,'X Memo Pool']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/html/search/variables_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['free_5fblocks_0',['free_blocks',['../structxmem__pool.html#ae129fe4209627a82f7319037b60c5612',1,'xmem_pool']]], 4 | ['free_5fblocks_5ftail_1',['free_blocks_tail',['../structxmem__pool.html#a59becc4c6a86620a973ef5d812d35570',1,'xmem_pool']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/html/search/all_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['a_20pool_0',['Creating a Pool',['../index.html#autotoc_md4',1,'']]], 4 | ['additional_20functions_1',['Additional Functions',['../index.html#autotoc_md8',1,'']]], 5 | ['allocating_20memory_2',['Allocating Memory',['../index.html#autotoc_md5',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /tools/cpplint/setup.cfg: -------------------------------------------------------------------------------- 1 | [aliases] 2 | test = pytest 3 | style = flake8 4 | ci = lint style test 5 | 6 | [tool:pytest] 7 | python_files = *test.py 8 | testpaths = . 9 | # running with tox reports only 75% 10 | addopts = --cov-fail-under=75 --cov=cpplint 11 | filterwarnings = 12 | ignore:.*:DeprecationWarning 13 | -------------------------------------------------------------------------------- /tools/cpplint/tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py27, py36, py37, py38, pypy, pypy3 3 | 4 | [testenv] 5 | deps = 6 | py36: flake8>=3.7.8 7 | py36: radon>=2.4.0 8 | py36: pylint>=1.8.4 9 | 10 | commands = 11 | {envpython} setup.py test 12 | py36: {envpython} setup.py lint 13 | py36: {envpython} setup.py style 14 | -------------------------------------------------------------------------------- /tools/cpplint/.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | 3 | python: 4 | - "3.8" 5 | - "3.7" 6 | - "3.6" 7 | - "3.5" 8 | - "2.7" 9 | - "pypy" 10 | - "pypy3" 11 | 12 | install: 13 | - pip install --upgrade pip 14 | - pip install --upgrade setuptools 15 | - pip install -e .[dev] 16 | - pip install tox-travis 17 | 18 | script: 19 | - tox 20 | -------------------------------------------------------------------------------- /docs/html/search/all_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['size_5fcount_5fwith_5f4_0',['size_count_with_4',['../xmempool_8c.html#a017124d3c7e4814c6502796b39509722',1,'xmempool.c']]], 4 | ['start_1',['start',['../structxmem__pool__block.html#ac5d567af757e520ea648f80f87a3e062',1,'xmem_pool_block::start'],['../structxmem__pool.html#a12120dc7808ef4f91d861eae6f6d29f1',1,'xmem_pool::start']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/html/search/variables_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['next_0',['next',['../structxmem__pool__block.html#a6787e0a646a2aaba653ecce38caa94eb',1,'xmem_pool_block::next'],['../structxmem__pool.html#a1929a43391b4a96acaba99885077f1bc',1,'xmem_pool::next']]], 4 | ['next_5falloc_5flength_1',['next_alloc_length',['../structxmem__pool.html#af1fb94eb5efcbd8f20bc0e4b97629ff6',1,'xmem_pool']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/html/search/variables_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['block_5fcount_0',['block_count',['../structxmem__pool.html#a5c4ccb1a0fd0de6808e27a527d09c966',1,'xmem_pool']]], 4 | ['block_5fsize_1',['block_size',['../structxmem__pool__block.html#a6875d9d46a942427f1377f5d050d0ad0',1,'xmem_pool_block::block_size'],['../structxmem__pool.html#a999a5e9a0ebafb774fc33f06ff014d12',1,'xmem_pool::block_size']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /tools/cpplint/samples/v8-sample/simple.def: -------------------------------------------------------------------------------- 1 | src/* 2 | 1 3 | 3 4 | Done processing src/interface-descriptors.h 5 | Total errors found: 2 6 | 7 | src/interface-descriptors.h:5: #ifndef header guard has wrong style, please use: SAMPLES_V8_SAMPLE_SRC_INTERFACE_DESCRIPTORS_H_ [build/header_guard] [5] 8 | src/interface-descriptors.h:1255: #endif line should be "#endif // SAMPLES_V8_SAMPLE_SRC_INTERFACE_DESCRIPTORS_H_" [build/header_guard] [5] 9 | 10 | -------------------------------------------------------------------------------- /tools/cpplint/MANIFEST.in: -------------------------------------------------------------------------------- 1 | # MANIFEST.in file required to deliver test files with source tar 2 | include *.py 3 | include LICENSE 4 | include test-requirements 5 | include dev-requirements 6 | 7 | # all samples for clitest 8 | graft samples 9 | 10 | global-exclude .tox 11 | global-exclude *~ 12 | global-exclude __pycache__ 13 | global-exclude .coverage 14 | global-exclude *.py[co] 15 | global-exclude *.db 16 | global-exclude .git* 17 | global-exclude *.orig 18 | -------------------------------------------------------------------------------- /docs/html/search/searchdata.js: -------------------------------------------------------------------------------- 1 | var indexSectionsWithContent = 2 | { 3 | 0: "acdflmoprtux", 4 | 1: "rx", 5 | 2: "x", 6 | 3: "x", 7 | 4: "x", 8 | 5: "mpx" 9 | }; 10 | 11 | var indexSectionNames = 12 | { 13 | 0: "all", 14 | 1: "files", 15 | 2: "functions", 16 | 3: "typedefs", 17 | 4: "defines", 18 | 5: "pages" 19 | }; 20 | 21 | var indexSectionLabels = 22 | { 23 | 0: "All", 24 | 1: "Files", 25 | 2: "Functions", 26 | 3: "Typedefs", 27 | 4: "Macros", 28 | 5: "Pages" 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | *.ko 4 | *.obj 5 | *.elf 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Libraries 12 | *.lib 13 | *.a 14 | *.la 15 | *.lo 16 | 17 | # Shared objects (inc. Windows DLLs) 18 | *.dll 19 | *.so 20 | *.so.* 21 | *.dylib 22 | 23 | # Executables 24 | *.exe 25 | *.out 26 | *.app 27 | *.i*86 28 | *.x86_64 29 | *.hex 30 | 31 | *.pyc 32 | *.swp 33 | xmempool-test 34 | xmempool-test-d 35 | *.d 36 | node_modules 37 | 38 | perf_alloc 39 | perf_xmem 40 | 41 | .clang-format-stamp 42 | .cpplint-stamp 43 | compile_commands.json 44 | -------------------------------------------------------------------------------- /docs/html/search/defines_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['xmempool_5fversion_5fmajor_0',['XMEMPOOL_VERSION_MAJOR',['../xmempool_8h.html#a17a7eb02e2c2ae4cb9713c302b8e1681',1,'xmempool.h']]], 4 | ['xmempool_5fversion_5fminor_1',['XMEMPOOL_VERSION_MINOR',['../xmempool_8h.html#a947fcce507007477f6b41c341a1f2c58',1,'xmempool.h']]], 5 | ['xmempool_5fversion_5fpatch_2',['XMEMPOOL_VERSION_PATCH',['../xmempool_8h.html#a48fc01dd2708dc316df0f5b7c2c27e20',1,'xmempool.h']]], 6 | ['xmempool_5fversion_5fstring_3',['XMEMPOOL_VERSION_STRING',['../xmempool_8h.html#a72a3dabdc4b900be326c3500743667b8',1,'xmempool.h']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /docs/html/search/defines_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['xmempool_5fversion_5fmajor_0',['XMEMPOOL_VERSION_MAJOR',['../xmempool_8h.html#a17a7eb02e2c2ae4cb9713c302b8e1681',1,'xmempool.h']]], 4 | ['xmempool_5fversion_5fminor_1',['XMEMPOOL_VERSION_MINOR',['../xmempool_8h.html#a947fcce507007477f6b41c341a1f2c58',1,'xmempool.h']]], 5 | ['xmempool_5fversion_5fpatch_2',['XMEMPOOL_VERSION_PATCH',['../xmempool_8h.html#a48fc01dd2708dc316df0f5b7c2c27e20',1,'xmempool.h']]], 6 | ['xmempool_5fversion_5fstring_3',['XMEMPOOL_VERSION_STRING',['../xmempool_8h.html#a72a3dabdc4b900be326c3500743667b8',1,'xmempool.h']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /docs/html/minus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/html/minusd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/html/search/variables_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['_5fblock_5fsize_0',['_block_size',['../xmempool_8c.html#a96a49339cc47ea3c27ba0dae822b04df',1,'xmempool.c']]], 4 | ['_5ffree_5fblock_5fptr_1',['_free_block_ptr',['../xmempool_8c.html#a8f4c2f28bc57149c38953ca0fd26c40a',1,'xmempool.c']]], 5 | ['_5ffree_5fblock_5fptr_5fend_2',['_free_block_ptr_end',['../xmempool_8c.html#afb0f258f67a7d6eac5ef90e6987ead30',1,'xmempool.c']]], 6 | ['_5fxmem_5fpage_5fsize_3',['_xmem_page_size',['../xmempool_8c.html#a652a9b8a5157e94e718f5d5283008fc4',1,'xmempool.c']]], 7 | ['_5fxmem_5fpool_5fnext_5falloc_5fblock_5fnode_5fcount_4',['_xmem_pool_next_alloc_block_node_count',['../xmempool_8c.html#a2f0f93b2aa138808bc0f2c5c2bce09bc',1,'xmempool.c']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /docs/html/plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/html/plusd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "xmempool", 3 | "version": "1.0.0", 4 | "description": "Toolkit for xmempool dev.", 5 | "devDependencies": { 6 | "clang-format": "^1.6.0", 7 | "eslint": "^8.7.0", 8 | "eslint-config-egg": "^10.0.0" 9 | }, 10 | "scripts": { 11 | "test": "make test && ./xmempool-test", 12 | "perf": "node perf.js" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/XadillaX/xmempool.git" 17 | }, 18 | "keywords": [ 19 | "perf", 20 | "xmempool" 21 | ], 22 | "author": "XadillaX", 23 | "license": "GPLv2", 24 | "bugs": { 25 | "url": "https://github.com/XadillaX/xmempool/issues" 26 | }, 27 | "homepage": "https://github.com/XadillaX/xmempool" 28 | } 29 | -------------------------------------------------------------------------------- /perf/common.h: -------------------------------------------------------------------------------- 1 | #ifndef PERF_COMMON_H_ 2 | #define PERF_COMMON_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "rdtsc.h" 8 | 9 | #define MAX_TEST_COUNT 10000000 10 | int test_count = 0; 11 | 12 | typedef struct test_struct { 13 | int id; 14 | char str[16]; 15 | } test_struct; 16 | 17 | test_struct* test_array[MAX_TEST_COUNT + 1]; 18 | 19 | void deal_with_test_count(int argc, char** argv) { 20 | if (argc <= 1) { 21 | test_count = 1000000; 22 | return; 23 | } 24 | 25 | char* str_times = argv[1]; 26 | int i_times = atoi(str_times); 27 | 28 | if (i_times < 0) i_times = 0; 29 | if (i_times > MAX_TEST_COUNT) i_times = MAX_TEST_COUNT; 30 | 31 | test_count = i_times; 32 | } 33 | 34 | #endif // PERF_COMMON_H_ 35 | -------------------------------------------------------------------------------- /docs/html/search/functions_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['xmem_5falloc_0',['xmem_alloc',['../xmempool_8h.html#a7ae69189c42c655bb25273f6f255c7a0',1,'xmempool.h']]], 4 | ['xmem_5fclean_5fup_1',['xmem_clean_up',['../xmempool_8h.html#a3ec7cd7c84271a41ae99ba6a727b4a61',1,'xmempool.h']]], 5 | ['xmem_5fcreate_5fpool_2',['xmem_create_pool',['../xmempool_8h.html#a5da6a9d8fc6b248bec44021df25d821c',1,'xmempool.h']]], 6 | ['xmem_5fdestroy_5fpool_3',['xmem_destroy_pool',['../xmempool_8h.html#afdeb5f34c46ca7bd3c77b889c6f121d7',1,'xmempool.h']]], 7 | ['xmem_5ffree_4',['xmem_free',['../xmempool_8h.html#aa472911be7f636d75cc749c58043202e',1,'xmempool.h']]], 8 | ['xmem_5fprint_5finfo_5',['xmem_print_info',['../xmempool_8h.html#a41a409f6d2e75d1d4bab65831f88e9cb',1,'xmempool.h']]] 9 | ]; 10 | -------------------------------------------------------------------------------- /docs/html/search/mag.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 14 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /docs/html/search/mag_d.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 14 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /perf/alloc.c: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | uint64_t total = 0; 4 | uint64_t alloc_total = 0; 5 | uint64_t free_total = 0; 6 | 7 | int main(int argc, char** argv) { 8 | deal_with_test_count(argc, argv); 9 | 10 | int size = sizeof(test_struct); 11 | uint64_t total_start, alloc_start, free_start; 12 | 13 | total_start = alloc_start = rdtsc(); 14 | for (int i = 0; i < test_count; i++) { 15 | test_array[i] = (test_struct*)malloc(size); 16 | } 17 | alloc_total = rdtsc() - alloc_start; 18 | 19 | free_start = rdtsc(); 20 | for (int i = 0; i < test_count; i++) { 21 | free(test_array[i]); 22 | } 23 | free_total = rdtsc() - free_start; 24 | total = rdtsc() - total_start; 25 | 26 | printf("=== perf of malloc\n"); 27 | printf("alloc & free times: %d\n", test_count); 28 | printf("alloc time: %lu CPU cycles\n", alloc_total); 29 | printf("free time: %lu CPU cycles\n", free_total); 30 | printf("total time: %lu CPU cycles\n", total); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /perf/report/macbook-m1.json: -------------------------------------------------------------------------------- 1 | {"./perf_xmem":[{"times":10,"alloc":29.3,"free":2.2,"total":117.4},{"times":100,"alloc":51.2,"free":11.9,"total":146.7},{"times":1000,"alloc":213.5,"free":70.9,"total":372.1},{"times":10000,"alloc":3232,"free":1074.5,"total":5294.2},{"times":100000,"alloc":27529.4,"free":14817.9,"total":50532.4},{"times":1000000,"alloc":267766,"free":163420.1,"total":541447},{"times":10000000,"alloc":2670050.7,"free":1618538.7,"total":5496111.1},{"times":10000000,"alloc":2761607,"free":1654117.5,"total":5645071.4}],"./perf_alloc":[{"times":10,"alloc":11.3,"free":13,"total":24.4},{"times":100,"alloc":47.2,"free":71.3,"total":118.5},{"times":1000,"alloc":408.1,"free":704.2,"total":1112.3},{"times":10000,"alloc":4001.9,"free":6973.3,"total":10975.3},{"times":100000,"alloc":42710.9,"free":83084.7,"total":125795.6},{"times":1000000,"alloc":413984.3,"free":899213.8,"total":1313212.5},{"times":10000000,"alloc":4140740.5,"free":12858954.1,"total":16999728.7},{"times":10000000,"alloc":4146482.1,"free":12737825.9,"total":16884317.5}]} -------------------------------------------------------------------------------- /docs/html/search/close.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /perf/report/huaban-dev.json: -------------------------------------------------------------------------------- 1 | {"./perf_xmem":[{"times":10,"alloc":4316.8,"free":482.4,"total":19529.6},{"times":100,"alloc":7081.2,"free":3734.4,"total":25980},{"times":1000,"alloc":57401.6,"free":27391.6,"total":99846},{"times":10000,"alloc":963756.8,"free":512234.4,"total":1690326},{"times":100000,"alloc":9382364.8,"free":4778318.8,"total":16099735.6},{"times":1000000,"alloc":87405898.4,"free":48729046.4,"total":153926956},{"times":10000000,"alloc":1082809374.4,"free":606202156,"total":1952134155.2},{"times":10000000,"alloc":1081459299.6,"free":604584866.8,"total":1949674956.8}],"./perf_alloc":[{"times":10,"alloc":97653.2,"free":4166.4,"total":101874.8},{"times":100,"alloc":101324.4,"free":7309.6,"total":108689.6},{"times":1000,"alloc":193274.4,"free":40183.2,"total":233514.8},{"times":10000,"alloc":1111108.8,"free":374126.8,"total":1485293.2},{"times":100000,"alloc":10559029.6,"free":3695396.8,"total":14254484.4},{"times":1000000,"alloc":111467646,"free":39247373.2,"total":150715077.2},{"times":10000000,"alloc":1106889791.6,"free":396196188.8,"total":1503086035.6},{"times":10000000,"alloc":1105497671.2,"free":393961228.4,"total":1499458954.4}]} -------------------------------------------------------------------------------- /perf/report/vps.json: -------------------------------------------------------------------------------- 1 | {"./perf_xmem":[{"times":10,"alloc":24951.6,"free":709.6,"total":49432.8},{"times":100,"alloc":36381.2,"free":4162,"total":65386},{"times":1000,"alloc":229063.3,"free":38334.6,"total":291006.8},{"times":10000,"alloc":3707695.8,"free":1410462,"total":5644559.6},{"times":100000,"alloc":30666495.3,"free":10299321.2,"total":46845326.4},{"times":1000000,"alloc":295576095,"free":96220954,"total":451967205.6},{"times":10000000,"alloc":2706789300.4,"free":871131138.4,"total":4254731180.4},{"times":10000000,"alloc":2752832002.4,"free":875976863.8,"total":4313220123.2}],"./perf_alloc":[{"times":10,"alloc":239765.6,"free":3984.8,"total":243807.6},{"times":100,"alloc":240783.2,"free":9308,"total":250148.4},{"times":1000,"alloc":448206.8,"free":64812.5,"total":513077.6},{"times":10000,"alloc":2926780.9,"free":498968,"total":3425806.1},{"times":100000,"alloc":27803112.2,"free":6164478.6,"total":33967653.8},{"times":1000000,"alloc":285312960.8,"free":61277696.4,"total":346590715.4},{"times":10000000,"alloc":2398735205.2,"free":609656881.2,"total":3008392147.8},{"times":10000000,"alloc":2383996957,"free":597081234.3,"total":2981078251.8}]} -------------------------------------------------------------------------------- /perf/report/zanarblahblah.json: -------------------------------------------------------------------------------- 1 | {"./perf_xmem":[{"times":10,"alloc":1173.6,"free":383.6,"total":10104.8},{"times":100,"alloc":9718.8,"free":1822.8,"total":20328.4},{"times":1000,"alloc":85150.8,"free":16020.8,"total":109889.6},{"times":10000,"alloc":1155014,"free":282274,"total":1546682.8},{"times":100000,"alloc":11603865.6,"free":2747750.4,"total":16274670.4},{"times":1000000,"alloc":112886031.8,"free":26817197.4,"total":157638284.4},{"times":10000000,"alloc":1342887245,"free":339350415,"total":1946483018.2},{"times":10000000,"alloc":1411829382.8,"free":355884357.6,"total":2024174383.2}],"./perf_alloc":[{"times":10,"alloc":3950.4,"free":4118,"total":8124.4},{"times":100,"alloc":33478.8,"free":32057.2,"total":65592.4},{"times":1000,"alloc":312811.6,"free":310386.4,"total":623254.4},{"times":10000,"alloc":3162913.6,"free":3106868.8,"total":6269838.4},{"times":100000,"alloc":31724080.8,"free":31756108.4,"total":63480245.2},{"times":1000000,"alloc":319266780,"free":317867819.2,"total":637134658},{"times":10000000,"alloc":3211709190.6,"free":3253840252.6,"total":6465549672.4},{"times":10000000,"alloc":3337355907.6,"free":3334449924.4,"total":6671806082}]} -------------------------------------------------------------------------------- /perf/report/macbook-air.json: -------------------------------------------------------------------------------- 1 | {"./perf_xmem":[{"times":10,"alloc":8524,"free":274.7,"total":22086.4},{"times":100,"alloc":9143.5,"free":1222.6,"total":20196.5},{"times":1000,"alloc":54111.4,"free":11856.8,"total":79467.2},{"times":10000,"alloc":966818.4,"free":415574.3,"total":1526970.3},{"times":100000,"alloc":8699388,"free":4099070.8,"total":14196120.4},{"times":1000000,"alloc":85837922.2,"free":36005187,"total":135477697.9},{"times":10000000,"alloc":1097308611.2,"free":521264073.1,"total":1903542243.9},{"times":10000000,"alloc":1186550055.2,"free":604603569.3,"total":2081353016.1}],"./perf_alloc":[{"times":10,"alloc":5282,"free":5520.7,"total":10843.2},{"times":100,"alloc":16750.3,"free":28802.9,"total":45595.5},{"times":1000,"alloc":126718.8,"free":220003.4,"total":346764.2},{"times":10000,"alloc":1271442.7,"free":2093563.5,"total":3365048.1},{"times":100000,"alloc":13081383.4,"free":23242086.3,"total":36323508.3},{"times":1000000,"alloc":133752463.7,"free":259788391.1,"total":393540900.3},{"times":10000000,"alloc":1434226234.4,"free":2604407105.1,"total":4038633385.8},{"times":10000000,"alloc":1453841988.6,"free":2620324508.4,"total":4074166541.5}]} -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2024 Khaidi ZHU 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /perf/xmem.c: -------------------------------------------------------------------------------- 1 | #include "../xmempool.h" 2 | #include "common.h" 3 | 4 | xmem_pool_handle pool = NULL; 5 | 6 | uint64_t total = 0; 7 | uint64_t alloc_total = 0; 8 | uint64_t free_total = 0; 9 | 10 | int main(int argc, char** argv) { 11 | deal_with_test_count(argc, argv); 12 | 13 | pool = xmem_create_pool(sizeof(test_struct)); 14 | 15 | uint64_t total_start, alloc_start, free_start; 16 | 17 | total_start = alloc_start = rdtsc(); 18 | for (int i = 0; i < test_count; i++) { 19 | test_array[i] = (test_struct*)xmem_alloc(pool); 20 | } 21 | alloc_total = rdtsc() - alloc_start; 22 | 23 | free_start = rdtsc(); 24 | for (int i = 0; i < test_count; i++) { 25 | xmem_free(pool, (char*)test_array[i]); 26 | } 27 | free_total = rdtsc() - free_start; 28 | xmem_destroy_pool(pool); 29 | 30 | total = rdtsc() - total_start; 31 | 32 | printf("=== perf of xmem\n"); 33 | printf("alloc & free times: %d\n", test_count); 34 | printf("alloc time: %lu CPU cycles\n", alloc_total); 35 | printf("free time: %lu CPU cycles\n", free_total); 36 | printf("total time: %lu CPU cycles\n", total); 37 | 38 | xmem_clean_up(); 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /docs/html/search/mag_sel.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 13 | 15 | 21 | 26 | 31 | 32 | -------------------------------------------------------------------------------- /docs/html/search/mag_seld.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 13 | 15 | 21 | 26 | 31 | 32 | -------------------------------------------------------------------------------- /tools/cpplint/.pylintrc: -------------------------------------------------------------------------------- 1 | [BASIC] 2 | include-naming-hint=yes 3 | method-rgx=[A-Z_][A-Za-z0-9]{2,49}$ 4 | function-rgx=[A-Z_][A-Za-z0-9]{2,49}$|main|unicode_escape_decode 5 | const-rgx=[a-zA-Z_][A-Za-z0-9_]{2,49}$ 6 | variable-rgx=[a-z_][a-z0-9_]{0,49}$ 7 | argument-rgx=[a-z_][a-z0-9_]{0,49}$ 8 | class-rgx=[A-Z_][a-zA-Z0-9]+$|basestring|unicode|long|xrange 9 | 10 | [MESSAGES CONTROL] 11 | disable= 12 | global-statement, 13 | multiple-statements, 14 | missing-docstring, 15 | no-else-return, 16 | no-self-use, 17 | consider-merging-isinstance, 18 | bad-continuation, 19 | fixme, 20 | bad-option-value, 21 | anomalous-unicode-escape-in-string, 22 | unused-argument, 23 | useless-object-inheritance, 24 | consider-using-dict-comprehension, 25 | consider-using-in, 26 | unnecessary-pass 27 | 28 | [REPORTS] 29 | output-format=colorized 30 | reports=no 31 | score=no 32 | 33 | [FORMAT] 34 | indent-string=' ' 35 | indent-after-paren=4 36 | max-module-lines=10000 37 | 38 | [DESIGN] 39 | max-locals=25 40 | max-line-length=100 41 | max-attributes=10 42 | max-branches=30 43 | max-args=20 44 | max-statements=75 45 | max-returns=10 46 | min-public-methods=0 47 | max-bool-expr=10 48 | -------------------------------------------------------------------------------- /tools/cpplint/.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | ignore = 3 | # indentation is not a multiple of four, 4 | E111,E114, 5 | # visually indented line with same indent as next logical line, 6 | E129, 7 | # expected 2 blank lines, found 1 8 | E302,E305, 9 | # closing bracket does not match indentation of opening bracket's line 10 | E123, 11 | # multiple spaces before operator 12 | E221, 13 | # line break before binary operator 14 | W503, 15 | # line break after binary operator 16 | W504, 17 | # multiple statements on one line 18 | E701, 19 | # continuation line under-indented for hanging indent 20 | E121, 21 | # closing bracket does not match visual indentation 22 | E124, 23 | # continuation line with same indent as next logical line 24 | E125, 25 | # continuation line over-indented for visual indent 26 | E127, 27 | # continuation line under-indented for visual indent 28 | E128, 29 | # unexpected indentation 30 | E116, 31 | # too many blank lines 32 | E303, 33 | # missing whitespace around arithmetic operator 34 | E226, 35 | # test for membership should be 'not in' 36 | E713, 37 | max-line-length=120 38 | -------------------------------------------------------------------------------- /test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "xmempool.h" 4 | 5 | #define TEST_COUNT 4096 6 | 7 | typedef struct test_struct { 8 | int id; 9 | char str[16]; 10 | } test_struct; 11 | 12 | void generate_str(char* str) { 13 | str[15] = 0; 14 | for (int i = 0; i < 15; i++) { 15 | str[i] = (rand() % 26) + 'a'; // NOLINT: runtime/threadsafe_fn 16 | } 17 | } 18 | 19 | void print_test_struct(test_struct* test) { 20 | printf("%d [0x%8X]: %s\n", test->id, (int)test, test->str); 21 | } 22 | 23 | int main() { 24 | xmem_pool_handle pool = xmem_create_pool(sizeof(test_struct)); 25 | test_struct* test_array[TEST_COUNT]; 26 | for (int i = 0; i < TEST_COUNT; i++) { 27 | test_array[i] = (test_struct*)xmem_alloc(pool); 28 | test_array[i]->id = i; 29 | generate_str(test_array[i]->str); 30 | print_test_struct(test_array[i]); 31 | } 32 | 33 | for (int i = 0; i < TEST_COUNT / 2; i++) { 34 | xmem_free(pool, (char*)test_array[i]); 35 | } 36 | 37 | xmem_print_info(pool); 38 | printf("\n"); 39 | 40 | for (int i = TEST_COUNT / 2; i < TEST_COUNT; i++) { 41 | xmem_free(pool, (char*)test_array[i]); 42 | } 43 | 44 | xmem_print_info(pool); 45 | 46 | xmem_destroy_pool(pool); 47 | 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /tools/cpplint/samples/boost-sample/LICENSE: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | 25 | -------------------------------------------------------------------------------- /docs/html/doc.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/html/docd.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/html/search/all_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['x_20memo_20pool_0',['X Memo Pool',['../index.html',1,'']]], 4 | ['xmem_5falloc_1',['xmem_alloc',['../xmempool_8h.html#a7ae69189c42c655bb25273f6f255c7a0',1,'xmempool.h']]], 5 | ['xmem_5fclean_5fup_2',['xmem_clean_up',['../xmempool_8h.html#a3ec7cd7c84271a41ae99ba6a727b4a61',1,'xmempool.h']]], 6 | ['xmem_5fcreate_5fpool_3',['xmem_create_pool',['../xmempool_8h.html#a5da6a9d8fc6b248bec44021df25d821c',1,'xmempool.h']]], 7 | ['xmem_5fdestroy_5fpool_4',['xmem_destroy_pool',['../xmempool_8h.html#afdeb5f34c46ca7bd3c77b889c6f121d7',1,'xmempool.h']]], 8 | ['xmem_5ffree_5',['xmem_free',['../xmempool_8h.html#aa472911be7f636d75cc749c58043202e',1,'xmempool.h']]], 9 | ['xmem_5fpool_5fhandle_6',['xmem_pool_handle',['../xmempool_8h.html#a3fce2e8b5d5306b76afb7870c053a664',1,'xmempool.h']]], 10 | ['xmem_5fprint_5finfo_7',['xmem_print_info',['../xmempool_8h.html#a41a409f6d2e75d1d4bab65831f88e9cb',1,'xmempool.h']]], 11 | ['xmempool_2eh_8',['xmempool.h',['../xmempool_8h.html',1,'']]], 12 | ['xmempool_5fversion_5fmajor_9',['XMEMPOOL_VERSION_MAJOR',['../xmempool_8h.html#a17a7eb02e2c2ae4cb9713c302b8e1681',1,'xmempool.h']]], 13 | ['xmempool_5fversion_5fminor_10',['XMEMPOOL_VERSION_MINOR',['../xmempool_8h.html#a947fcce507007477f6b41c341a1f2c58',1,'xmempool.h']]], 14 | ['xmempool_5fversion_5fpatch_11',['XMEMPOOL_VERSION_PATCH',['../xmempool_8h.html#a48fc01dd2708dc316df0f5b7c2c27e20',1,'xmempool.h']]], 15 | ['xmempool_5fversion_5fstring_12',['XMEMPOOL_VERSION_STRING',['../xmempool_8h.html#a72a3dabdc4b900be326c3500743667b8',1,'xmempool.h']]] 16 | ]; 17 | -------------------------------------------------------------------------------- /tools/cpplint/LICENSE: -------------------------------------------------------------------------------- 1 | cpplint.py and its corresponding unit tests are Copyright (C) 2009 Google Inc. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /tools/cpplint/samples/v8-sample/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2006-2011, the V8 project authors. All rights reserved. 2 | Redistribution and use in source and binary forms, with or without 3 | modification, are permitted provided that the following conditions are 4 | met: 5 | 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above 9 | copyright notice, this list of conditions and the following 10 | disclaimer in the documentation and/or other materials provided 11 | with the distribution. 12 | * Neither the name of Google Inc. nor the names of its 13 | contributors may be used to endorse or promote products derived 14 | from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | -------------------------------------------------------------------------------- /docs/html/menudata.js: -------------------------------------------------------------------------------- 1 | /* 2 | @licstart The following is the entire license notice for the JavaScript code in this file. 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (C) 1997-2020 by Dimitri van Heesch 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 9 | and associated documentation files (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 11 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all copies or 15 | substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 18 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | @licend The above is the entire license notice for the JavaScript code in this file 24 | */ 25 | var menudata={children:[ 26 | {text:"Main Page",url:"index.html"}, 27 | {text:"Files",url:"files.html",children:[ 28 | {text:"File List",url:"files.html"}, 29 | {text:"Globals",url:"globals.html",children:[ 30 | {text:"All",url:"globals.html"}, 31 | {text:"Functions",url:"globals_func.html"}, 32 | {text:"Typedefs",url:"globals_type.html"}, 33 | {text:"Macros",url:"globals_defs.html"}]}]}]} 34 | -------------------------------------------------------------------------------- /docs/html/search/functions_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['xmem_5falloc_0',['xmem_alloc',['../xmempool_8h.html#a7ae69189c42c655bb25273f6f255c7a0',1,'xmem_alloc(xmem_pool_handle handle): xmempool.c'],['../xmempool_8c.html#a7ae69189c42c655bb25273f6f255c7a0',1,'xmem_alloc(xmem_pool_handle handle): xmempool.c']]], 4 | ['xmem_5fclean_5fup_1',['xmem_clean_up',['../xmempool_8h.html#a3ec7cd7c84271a41ae99ba6a727b4a61',1,'xmem_clean_up(): xmempool.c'],['../xmempool_8c.html#a3ec7cd7c84271a41ae99ba6a727b4a61',1,'xmem_clean_up(): xmempool.c']]], 5 | ['xmem_5fcreate_5fpool_2',['xmem_create_pool',['../xmempool_8h.html#a5da6a9d8fc6b248bec44021df25d821c',1,'xmem_create_pool(uint32_t block_size): xmempool.h'],['../xmempool_8c.html#afecd089ea446a199bf591cd94e7372ce',1,'xmem_create_pool(unsigned int block_size): xmempool.c']]], 6 | ['xmem_5fdestroy_5fpool_3',['xmem_destroy_pool',['../xmempool_8h.html#afdeb5f34c46ca7bd3c77b889c6f121d7',1,'xmem_destroy_pool(xmem_pool_handle pool): xmempool.c'],['../xmempool_8c.html#aee79a7d27db17f354fe66b49871aa223',1,'xmem_destroy_pool(xmem_pool_handle handle): xmempool.c']]], 7 | ['xmem_5ffree_4',['xmem_free',['../xmempool_8h.html#aa472911be7f636d75cc749c58043202e',1,'xmem_free(xmem_pool_handle handle, char *pointer): xmempool.c'],['../xmempool_8c.html#aa472911be7f636d75cc749c58043202e',1,'xmem_free(xmem_pool_handle handle, char *pointer): xmempool.c']]], 8 | ['xmem_5finit_5',['xmem_init',['../xmempool_8c.html#a59bdcd8796f1c2ea3b19b1fe187db069',1,'xmempool.c']]], 9 | ['xmem_5fprint_5finfo_6',['xmem_print_info',['../xmempool_8h.html#a41a409f6d2e75d1d4bab65831f88e9cb',1,'xmem_print_info(xmem_pool_handle pool): xmempool.c'],['../xmempool_8c.html#a4a1008d2aa511fb0e5144ddb916b4a3e',1,'xmem_print_info(xmem_pool_handle _pool): xmempool.c']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /tools/cpplint/samples/protobuf-sample/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008 Google Inc. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | Code generated by the Protocol Buffer compiler is owned by the owner 30 | of the input file used when generating it. This code is not 31 | standalone and requires a support library to be linked with it. This 32 | support library is itself covered by the above license. 33 | 34 | -------------------------------------------------------------------------------- /tools/cpplint/samples/boost-sample/src/inspect/unnamed_namespace_check.hpp: -------------------------------------------------------------------------------- 1 | // unnamed_namespace_check -----------------------------------------// 2 | 3 | // Copyright Gennaro Prota 2006. 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. 6 | // (See accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | #include "boost/regex.hpp" 10 | #include "boost/lexical_cast.hpp" 11 | #include "unnamed_namespace_check.hpp" 12 | 13 | 14 | namespace { 15 | 16 | 17 | boost::regex unnamed_namespace_regex( 18 | "\\ 5 | 6 | #if defined(__GNUC__) && !defined(__INTEL_COMPILER) 7 | #define ALWAYS_INLINE __attribute__((always_inline)) inline 8 | #define INLINE inline 9 | #else 10 | #define ALWAYS_INLINE __forceinline 11 | #define INLINE __inline 12 | #endif 13 | 14 | #if defined(__i386__) 15 | 16 | ALWAYS_INLINE uint64_t rdtsc(void) 17 | { 18 | unsigned long long int x; 19 | __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x)); 20 | return x; 21 | } 22 | #elif defined(__x86_64__) 23 | 24 | ALWAYS_INLINE uint64_t rdtsc(void) 25 | { 26 | unsigned hi, lo; 27 | __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); 28 | return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 ); 29 | } 30 | 31 | #elif defined(__powerpc__) 32 | 33 | ALWAYS_INLINE uint64_t rdtsc(void) 34 | { 35 | unsigned long long int result=0; 36 | unsigned long int upper, lower,tmp; 37 | __asm__ volatile( 38 | "0: \n" 39 | "\tmftbu %0 \n" 40 | "\tmftb %1 \n" 41 | "\tmftbu %2 \n" 42 | "\tcmpw %2,%0 \n" 43 | "\tbne 0b \n" 44 | : "=r"(upper),"=r"(lower),"=r"(tmp) 45 | ); 46 | result = upper; 47 | result = result<<32; 48 | result = result|lower; 49 | 50 | return(result); 51 | } 52 | 53 | #elif defined(__aarch64__) 54 | 55 | ALWAYS_INLINE uint64_t rdtsc(void) 56 | { 57 | uint64_t virtual_timer_value; 58 | __asm__ volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value)); 59 | return virtual_timer_value; 60 | } 61 | 62 | #else 63 | 64 | #error "No tick counter is available!" 65 | 66 | #endif 67 | 68 | 69 | /* $RCSfile: $ $Author: kazutomo $ 70 | * $Revision: 1.6 $ $Date: 2005/04/13 18:49:58 $ 71 | */ 72 | 73 | #endif 74 | 75 | 76 | -------------------------------------------------------------------------------- /docs/html/folderclosed.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/html/folderclosedd.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Doxyfile: -------------------------------------------------------------------------------- 1 | # Doxyfile for xmempool 2 | 3 | # Project related configuration options 4 | PROJECT_NAME = "xmempool" 5 | PROJECT_NUMBER = 1.1.2 6 | PROJECT_BRIEF = "A memory pool implemented by C." 7 | OUTPUT_DIRECTORY = docs 8 | CREATE_SUBDIRS = NO 9 | ALLOW_UNICODE_NAMES = NO 10 | OUTPUT_LANGUAGE = English 11 | 12 | # Build related configuration options 13 | EXTRACT_ALL = YES 14 | EXTRACT_PRIVATE = YES 15 | EXTRACT_STATIC = YES 16 | 17 | # Input files 18 | INPUT = xmempool.h README.md 19 | FILE_PATTERNS = *.h *.md 20 | RECURSIVE = NO 21 | 22 | # Output options 23 | GENERATE_HTML = YES 24 | HTML_OUTPUT = html 25 | GENERATE_LATEX = NO 26 | 27 | # Preprocessing 28 | ENABLE_PREPROCESSING = YES 29 | MACRO_EXPANSION = YES 30 | EXPAND_ONLY_PREDEF = NO 31 | 32 | # Dot tool configuration 33 | HAVE_DOT = NO 34 | 35 | # Source browsing 36 | SOURCE_BROWSER = YES 37 | INLINE_SOURCES = YES 38 | 39 | # Index 40 | ALPHABETICAL_INDEX = YES 41 | 42 | # Message options 43 | QUIET = NO 44 | WARNINGS = YES 45 | WARN_IF_UNDOCUMENTED = YES 46 | WARN_IF_DOC_ERROR = YES 47 | 48 | # C-specific options 49 | OPTIMIZE_OUTPUT_FOR_C = YES 50 | TYPEDEF_HIDES_STRUCT = YES 51 | 52 | # Documentation options 53 | JAVADOC_AUTOBRIEF = YES 54 | QT_AUTOBRIEF = YES 55 | MULTILINE_CPP_IS_BRIEF = YES 56 | INHERIT_DOCS = YES 57 | SEPARATE_MEMBER_PAGES = NO 58 | TAB_SIZE = 4 59 | ALIASES = 60 | OPTIMIZE_OUTPUT_FOR_C = YES 61 | BUILTIN_STL_SUPPORT = NO 62 | CPP_CLI_SUPPORT = NO 63 | SIP_SUPPORT = NO 64 | IDL_PROPERTY_SUPPORT = YES 65 | DISTRIBUTE_GROUP_DOC = NO 66 | GROUP_NESTED_COMPOUNDS = NO 67 | SUBGROUPING = YES 68 | INLINE_GROUPED_CLASSES = NO 69 | INLINE_SIMPLE_STRUCTS = NO 70 | 71 | # Docstring options 72 | USE_MDFILE_AS_MAINPAGE = README.md 73 | MARKDOWN_SUPPORT = YES 74 | -------------------------------------------------------------------------------- /tools/cpplint/samples/chromium-sample/simple.def: -------------------------------------------------------------------------------- 1 | src/* 2 | 1 3 | 6 4 | Done processing src/chrome_content_renderer_client.cc 5 | Done processing src/chrome_content_renderer_client.h 6 | Done processing src/io_thread.cc 7 | Done processing src/io_thread.h 8 | Total errors found: 13 9 | 10 | src/chrome_content_renderer_client.cc:113: Include the directory when naming .h files [build/include_subdir] [4] 11 | src/chrome_content_renderer_client.cc:1156: Use int16/int64/etc, rather than the C type long [runtime/int] [4] 12 | src/chrome_content_renderer_client.cc:1161: Use int16/int64/etc, rather than the C type long [runtime/int] [4] 13 | src/chrome_content_renderer_client.cc:5: samples/chromium-sample/src/chrome_content_renderer_client.cc should include its header file samples/chromium-sample/src/chrome_content_renderer_client.h [build/include] [5] 14 | src/chrome_content_renderer_client.h:5: #ifndef header guard has wrong style, please use: SAMPLES_CHROMIUM_SAMPLE_SRC_CHROME_CONTENT_RENDERER_CLIENT_H_ [build/header_guard] [5] 15 | src/chrome_content_renderer_client.h:225: #endif line should be "#endif // SAMPLES_CHROMIUM_SAMPLE_SRC_CHROME_CONTENT_RENDERER_CLIENT_H_" [build/header_guard] [5] 16 | src/chrome_content_renderer_client.h:115: Use int16/int64/etc, rather than the C type long [runtime/int] [4] 17 | src/chrome_content_renderer_client.h:117: Use int16/int64/etc, rather than the C type long [runtime/int] [4] 18 | src/io_thread.cc:1148: Closing ) should be moved to the previous line [whitespace/parens] [2] 19 | src/io_thread.cc:1547: Missing space around colon in range-based for loop [whitespace/forcolon] [2] 20 | src/io_thread.cc:5: samples/chromium-sample/src/io_thread.cc should include its header file samples/chromium-sample/src/io_thread.h [build/include] [5] 21 | src/io_thread.h:5: #ifndef header guard has wrong style, please use: SAMPLES_CHROMIUM_SAMPLE_SRC_IO_THREAD_H_ [build/header_guard] [5] 22 | src/io_thread.h:565: #endif line should be "#endif // SAMPLES_CHROMIUM_SAMPLE_SRC_IO_THREAD_H_" [build/header_guard] [5] 23 | 24 | -------------------------------------------------------------------------------- /perf.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const { exec, execSync } = require('child_process'); 4 | const fs = require('fs'); 5 | 6 | const TEST_TIME = 10; 7 | const regexp = /.*?(\d+).*\n.*?(\d+).*\n.*?(\d+).*\n.*?(\d+)/; 8 | 9 | exec('make perf_xmem && make perf_alloc', function(err) { 10 | if (err) { 11 | console.error('Error occurred while compling: ' + err.message); 12 | process.exit(4); 13 | } 14 | 15 | const times = [ 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000 ]; 16 | const cases = [ './perf_xmem', './perf_alloc' ]; 17 | const result = {}; 18 | 19 | for (let i = 0; i < cases.length; i++) { 20 | console.log('testing `' + cases[i] + '`...'); 21 | result[cases[i]] = []; 22 | for (let j = 0; j < times.length; j++) { 23 | console.log(' testing `' + cases[i] + ' ' + times[j] + '`...'); 24 | const test = { 25 | times: 0, 26 | alloc: 0, 27 | free: 0, 28 | total: 0, 29 | }; 30 | 31 | for (let k = 0; k < TEST_TIME; k++) { 32 | console.log(`testing \`${cases[i]} ${times[j]} for ${k} times...\``); 33 | const stdout = execSync(cases[i] + ' ' + times[j]); 34 | const output = regexp.exec(stdout); 35 | test.times += Number(output[1]); 36 | test.alloc += Number(output[2]); 37 | test.free += Number(output[3]); 38 | test.total += Number(output[4]); 39 | console.log(' done.'); 40 | } 41 | 42 | for (const key in test) { 43 | if (!test.hasOwnProperty(key)) continue; 44 | test[key] /= TEST_TIME; 45 | } 46 | 47 | result[cases[i]].push(test); 48 | console.log(' done.'); 49 | } 50 | console.log('done.'); 51 | } 52 | 53 | // eslint-disable-next-line node/prefer-promises/fs 54 | fs.writeFile( 55 | `./perf/report/${Date.now()}.json`, 56 | JSON.stringify(result), 57 | { encoding: 'utf8' }, 58 | function(err) { 59 | if (err) { 60 | console.error('error occurred: ' + err.message); 61 | } else { 62 | console.log('😊 all done!'); 63 | } 64 | }); 65 | }); 66 | -------------------------------------------------------------------------------- /docs/html/cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Cookie helper functions 3 | Copyright (c) 2023 Dimitri van Heesch 4 | Released under MIT license. 5 | */ 6 | let Cookie = { 7 | cookie_namespace: 'doxygen_', 8 | 9 | readSetting(cookie,defVal) { 10 | if (window.chrome) { 11 | const val = localStorage.getItem(this.cookie_namespace+cookie) || 12 | sessionStorage.getItem(this.cookie_namespace+cookie); 13 | if (val) return val; 14 | } else { 15 | let myCookie = this.cookie_namespace+cookie+"="; 16 | if (document.cookie) { 17 | const index = document.cookie.indexOf(myCookie); 18 | if (index != -1) { 19 | const valStart = index + myCookie.length; 20 | let valEnd = document.cookie.indexOf(";", valStart); 21 | if (valEnd == -1) { 22 | valEnd = document.cookie.length; 23 | } 24 | return document.cookie.substring(valStart, valEnd); 25 | } 26 | } 27 | } 28 | return defVal; 29 | }, 30 | 31 | writeSetting(cookie,val,days=10*365) { // default days='forever', 0=session cookie, -1=delete 32 | if (window.chrome) { 33 | if (days==0) { 34 | sessionStorage.setItem(this.cookie_namespace+cookie,val); 35 | } else { 36 | localStorage.setItem(this.cookie_namespace+cookie,val); 37 | } 38 | } else { 39 | let date = new Date(); 40 | date.setTime(date.getTime()+(days*24*60*60*1000)); 41 | const expiration = days!=0 ? "expires="+date.toGMTString()+";" : ""; 42 | document.cookie = this.cookie_namespace + cookie + "=" + 43 | val + "; SameSite=Lax;" + expiration + "path=/"; 44 | } 45 | }, 46 | 47 | eraseSetting(cookie) { 48 | if (window.chrome) { 49 | if (localStorage.getItem(this.cookie_namespace+cookie)) { 50 | localStorage.removeItem(this.cookie_namespace+cookie); 51 | } else if (sessionStorage.getItem(this.cookie_namespace+cookie)) { 52 | sessionStorage.removeItem(this.cookie_namespace+cookie); 53 | } 54 | } else { 55 | this.writeSetting(cookie,'',-1); 56 | } 57 | }, 58 | } 59 | -------------------------------------------------------------------------------- /tools/cpplint/.gitignore: -------------------------------------------------------------------------------- 1 | ### Python ### 2 | # Byte-compiled / optimized / DLL files 3 | __pycache__/ 4 | *.py[cod] 5 | *$py.class 6 | 7 | # C extensions 8 | *.so 9 | 10 | # Distribution / packaging 11 | .Python 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | .hypothesis/ 50 | .pytest_cache/ 51 | 52 | # Translations 53 | *.mo 54 | *.pot 55 | 56 | # Django stuff: 57 | *.log 58 | local_settings.py 59 | db.sqlite3 60 | 61 | # Flask stuff: 62 | instance/ 63 | .webassets-cache 64 | 65 | # Scrapy stuff: 66 | .scrapy 67 | 68 | # Sphinx documentation 69 | docs/_build/ 70 | 71 | # PyBuilder 72 | target/ 73 | 74 | # Jupyter Notebook 75 | .ipynb_checkpoints 76 | 77 | # IPython 78 | profile_default/ 79 | ipython_config.py 80 | 81 | # pyenv 82 | .python-version 83 | 84 | # celery beat schedule file 85 | celerybeat-schedule 86 | 87 | # SageMath parsed files 88 | *.sage.py 89 | 90 | # Environments 91 | .env 92 | .venv 93 | env/ 94 | venv/ 95 | ENV/ 96 | env.bak/ 97 | venv.bak/ 98 | 99 | # Spyder project settings 100 | .spyderproject 101 | .spyproject 102 | 103 | # Rope project settings 104 | .ropeproject 105 | 106 | # mkdocs documentation 107 | /site 108 | 109 | # mypy 110 | .mypy_cache/ 111 | .dmypy.json 112 | dmypy.json 113 | 114 | ### Python Patch ### 115 | .venv/ 116 | 117 | ### Python.VirtualEnv Stack ### 118 | # Virtualenv 119 | # http://iamzed.com/2009/05/07/a-primer-on-virtualenv/ 120 | [Bb]in 121 | [Ii]nclude 122 | [Ll]ib 123 | [Ll]ib64 124 | [Ll]ocal 125 | [Ss]cripts 126 | pyvenv.cfg 127 | pip-selfcheck.json 128 | -------------------------------------------------------------------------------- /docs/html/doxygen_crawl.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Validator / crawler helper 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /tools/cpplint/samples/silly-sample/filters.def: -------------------------------------------------------------------------------- 1 | --counting=toplevel --filter=-whitespace,-build/include_what_you_use src/*.cpp 2 | 1 3 | 7 4 | Done processing src/sillycode.cpp 5 | Category 'build' errors found: 1 6 | Category 'legal' errors found: 1 7 | Category 'readability' errors found: 5 8 | Category 'runtime' errors found: 12 9 | Total errors found: 19 10 | 11 | src/sillycode.cpp:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5] 12 | src/sillycode.cpp:3: Found C system header after C++ system header. Should be: sillycode.h, c system, c++ system, other. [build/include_order] [4] 13 | src/sillycode.cpp:14: Is this a non-const reference? If so, make const or use a pointer: vector& v [runtime/references] [2] 14 | src/sillycode.cpp:40: If/else bodies with multiple statements require braces [readability/braces] [4] 15 | src/sillycode.cpp:66: Single-parameter constructors should be marked explicit. [runtime/explicit] [5] 16 | src/sillycode.cpp:76: Single-parameter constructors should be marked explicit. [runtime/explicit] [5] 17 | src/sillycode.cpp:85: Constructors callable with one argument should be marked explicit. [runtime/explicit] [5] 18 | src/sillycode.cpp:118: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] 19 | src/sillycode.cpp:118: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] 20 | src/sillycode.cpp:123: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] 21 | src/sillycode.cpp:123: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] 22 | src/sillycode.cpp:171: Do not use variable-length arrays. Use an appropriately named ('k' followed by CamelCase) compile-time constant for the size. [runtime/arrays] [1] 23 | src/sillycode.cpp:178: Static/global string variables are not permitted. [runtime/string] [4] 24 | src/sillycode.cpp:199: If an else has a brace on one side, it should have it on both [readability/braces] [5] 25 | src/sillycode.cpp:202: If an else has a brace on one side, it should have it on both [readability/braces] [5] 26 | src/sillycode.cpp:208: Static/global string variables are not permitted. [runtime/string] [4] 27 | src/sillycode.cpp:227: Static/global string variables are not permitted. [runtime/string] [4] 28 | src/sillycode.cpp:228: Using C-style cast. Use reinterpret_cast(...) instead [readability/casting] [4] 29 | src/sillycode.cpp:243: Using C-style cast. Use reinterpret_cast(...) instead [readability/casting] [4] 30 | 31 | -------------------------------------------------------------------------------- /docs/html/search/all_10.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['x_20memo_20pool_0',['X Memo Pool',['../index.html',1,'']]], 4 | ['xmem_5falloc_1',['xmem_alloc',['../xmempool_8h.html#a7ae69189c42c655bb25273f6f255c7a0',1,'xmem_alloc(xmem_pool_handle handle): xmempool.c'],['../xmempool_8c.html#a7ae69189c42c655bb25273f6f255c7a0',1,'xmem_alloc(xmem_pool_handle handle): xmempool.c']]], 5 | ['xmem_5fclean_5fup_2',['xmem_clean_up',['../xmempool_8h.html#a3ec7cd7c84271a41ae99ba6a727b4a61',1,'xmem_clean_up(): xmempool.c'],['../xmempool_8c.html#a3ec7cd7c84271a41ae99ba6a727b4a61',1,'xmem_clean_up(): xmempool.c']]], 6 | ['xmem_5fcreate_5fpool_3',['xmem_create_pool',['../xmempool_8h.html#a5da6a9d8fc6b248bec44021df25d821c',1,'xmem_create_pool(uint32_t block_size): xmempool.h'],['../xmempool_8c.html#afecd089ea446a199bf591cd94e7372ce',1,'xmem_create_pool(unsigned int block_size): xmempool.c']]], 7 | ['xmem_5fdestroy_5fpool_4',['xmem_destroy_pool',['../xmempool_8h.html#afdeb5f34c46ca7bd3c77b889c6f121d7',1,'xmem_destroy_pool(xmem_pool_handle pool): xmempool.c'],['../xmempool_8c.html#aee79a7d27db17f354fe66b49871aa223',1,'xmem_destroy_pool(xmem_pool_handle handle): xmempool.c']]], 8 | ['xmem_5ffree_5',['xmem_free',['../xmempool_8h.html#aa472911be7f636d75cc749c58043202e',1,'xmem_free(xmem_pool_handle handle, char *pointer): xmempool.c'],['../xmempool_8c.html#aa472911be7f636d75cc749c58043202e',1,'xmem_free(xmem_pool_handle handle, char *pointer): xmempool.c']]], 9 | ['xmem_5finit_6',['xmem_init',['../xmempool_8c.html#a59bdcd8796f1c2ea3b19b1fe187db069',1,'xmempool.c']]], 10 | ['xmem_5fpool_7',['xmem_pool',['../structxmem__pool.html',1,'']]], 11 | ['xmem_5fpool_5fblock_8',['xmem_pool_block',['../structxmem__pool__block.html',1,'']]], 12 | ['xmem_5fpool_5fhandle_9',['xmem_pool_handle',['../xmempool_8h.html#a3fce2e8b5d5306b76afb7870c053a664',1,'xmempool.h']]], 13 | ['xmem_5fprint_5finfo_10',['xmem_print_info',['../xmempool_8h.html#a41a409f6d2e75d1d4bab65831f88e9cb',1,'xmem_print_info(xmem_pool_handle pool): xmempool.c'],['../xmempool_8c.html#a4a1008d2aa511fb0e5144ddb916b4a3e',1,'xmem_print_info(xmem_pool_handle _pool): xmempool.c']]], 14 | ['xmempool_2ec_11',['xmempool.c',['../xmempool_8c.html',1,'']]], 15 | ['xmempool_2eh_12',['xmempool.h',['../xmempool_8h.html',1,'']]], 16 | ['xmempool_5fversion_5fmajor_13',['XMEMPOOL_VERSION_MAJOR',['../xmempool_8h.html#a17a7eb02e2c2ae4cb9713c302b8e1681',1,'xmempool.h']]], 17 | ['xmempool_5fversion_5fminor_14',['XMEMPOOL_VERSION_MINOR',['../xmempool_8h.html#a947fcce507007477f6b41c341a1f2c58',1,'xmempool.h']]], 18 | ['xmempool_5fversion_5fpatch_15',['XMEMPOOL_VERSION_PATCH',['../xmempool_8h.html#a48fc01dd2708dc316df0f5b7c2c27e20',1,'xmempool.h']]], 19 | ['xmempool_5fversion_5fstring_16',['XMEMPOOL_VERSION_STRING',['../xmempool_8h.html#a72a3dabdc4b900be326c3500743667b8',1,'xmempool.h']]] 20 | ]; 21 | -------------------------------------------------------------------------------- /docs/html/navtree.css: -------------------------------------------------------------------------------- 1 | #nav-tree .children_ul { 2 | margin:0; 3 | padding:4px; 4 | } 5 | 6 | #nav-tree ul { 7 | list-style:none outside none; 8 | margin:0px; 9 | padding:0px; 10 | } 11 | 12 | #nav-tree li { 13 | white-space:nowrap; 14 | margin:0px; 15 | padding:0px; 16 | } 17 | 18 | #nav-tree .plus { 19 | margin:0px; 20 | } 21 | 22 | #nav-tree .selected { 23 | background-image: url('tab_a.png'); 24 | background-repeat:repeat-x; 25 | color: var(--nav-text-active-color); 26 | text-shadow: var(--nav-text-active-shadow); 27 | } 28 | 29 | #nav-tree .selected .arrow { 30 | color: var(--nav-arrow-selected-color); 31 | text-shadow: none; 32 | } 33 | 34 | #nav-tree img { 35 | margin:0px; 36 | padding:0px; 37 | border:0px; 38 | vertical-align: middle; 39 | } 40 | 41 | #nav-tree a { 42 | text-decoration:none; 43 | padding:0px; 44 | margin:0px; 45 | } 46 | 47 | #nav-tree .label { 48 | margin:0px; 49 | padding:0px; 50 | font: 12px var(--font-family-nav); 51 | } 52 | 53 | #nav-tree .label a { 54 | padding:2px; 55 | } 56 | 57 | #nav-tree .selected a { 58 | text-decoration:none; 59 | color:var(--nav-text-active-color); 60 | } 61 | 62 | #nav-tree .children_ul { 63 | margin:0px; 64 | padding:0px; 65 | } 66 | 67 | #nav-tree .item { 68 | margin:0px; 69 | padding:0px; 70 | } 71 | 72 | #nav-tree { 73 | padding: 0px 0px; 74 | font-size:14px; 75 | overflow:auto; 76 | } 77 | 78 | #doc-content { 79 | overflow:auto; 80 | display:block; 81 | padding:0px; 82 | margin:0px; 83 | -webkit-overflow-scrolling : touch; /* iOS 5+ */ 84 | } 85 | 86 | #side-nav { 87 | padding:0 6px 0 0; 88 | margin: 0px; 89 | display:block; 90 | position: absolute; 91 | left: 0px; 92 | width: $width; 93 | overflow : hidden; 94 | } 95 | 96 | .ui-resizable .ui-resizable-handle { 97 | display:block; 98 | } 99 | 100 | .ui-resizable-e { 101 | background-image:var(--nav-splitbar-image); 102 | background-size:100%; 103 | background-repeat:repeat-y; 104 | background-attachment: scroll; 105 | cursor:ew-resize; 106 | height:100%; 107 | right:0; 108 | top:0; 109 | width:6px; 110 | } 111 | 112 | .ui-resizable-handle { 113 | display:none; 114 | font-size:0.1px; 115 | position:absolute; 116 | z-index:1; 117 | } 118 | 119 | #nav-tree-contents { 120 | margin: 6px 0px 0px 0px; 121 | } 122 | 123 | #nav-tree { 124 | background-repeat:repeat-x; 125 | background-color: var(--nav-background-color); 126 | -webkit-overflow-scrolling : touch; /* iOS 5+ */ 127 | } 128 | 129 | #nav-sync { 130 | position:absolute; 131 | top:5px; 132 | right:24px; 133 | z-index:0; 134 | } 135 | 136 | #nav-sync img { 137 | opacity:0.3; 138 | } 139 | 140 | #nav-sync img:hover { 141 | opacity:0.9; 142 | } 143 | 144 | @media print 145 | { 146 | #nav-tree { display: none; } 147 | div.ui-resizable-handle { display: none; position: relative; } 148 | } 149 | 150 | -------------------------------------------------------------------------------- /tools/cpplint/README.rst: -------------------------------------------------------------------------------- 1 | cpplint - static code checker for C++ 2 | ===================================== 3 | 4 | .. image:: https://travis-ci.org/cpplint/cpplint.svg?branch=master 5 | :target: https://travis-ci.org/cpplint/cpplint 6 | 7 | .. image:: https://img.shields.io/pypi/v/cpplint.svg 8 | :target: https://pypi.python.org/pypi/cpplint 9 | 10 | .. image:: https://img.shields.io/pypi/pyversions/cpplint.svg 11 | :target: https://pypi.python.org/pypi/cpplint 12 | 13 | .. image:: https://img.shields.io/pypi/status/cpplint.svg 14 | :target: https://pypi.python.org/pypi/cpplint 15 | 16 | .. image:: https://img.shields.io/pypi/l/cpplint.svg 17 | :target: https://pypi.python.org/pypi/cpplint 18 | 19 | .. image:: https://img.shields.io/pypi/dd/cpplint.svg 20 | :target: https://pypi.python.org/pypi/cpplint 21 | 22 | .. image:: https://img.shields.io/pypi/dw/cpplint.svg 23 | :target: https://pypi.python.org/pypi/cpplint 24 | 25 | .. image:: https://img.shields.io/pypi/dm/cpplint.svg 26 | :target: https://pypi.python.org/pypi/cpplint 27 | 28 | Cpplint is a command-line tool to check C/C++ files for style issues following `Google's C++ style guide `_. 29 | Cpplint is developed and maintained by Google Inc. at `google/styleguide `_, also see the `wikipedia entry `_ 30 | 31 | While Google maintains cpplint, Google is not (very) responsive to issues and pull requests, this fork aims to be (somewhat) more open to add fixes to cpplint to enable fixes, when those fixes make cpplint usable in wider contexts. 32 | Also see discussion here https://github.com/google/styleguide/pull/528. 33 | 34 | 35 | Installation 36 | ============ 37 | 38 | 39 | To install cpplint from PyPI, run: 40 | 41 | .. code-block:: bash 42 | 43 | $ pip install cpplint 44 | 45 | Then run it with: 46 | 47 | .. code-block:: bash 48 | 49 | $ cpplint [OPTIONS] files 50 | 51 | For full usage instructions, run: 52 | 53 | .. code-block:: bash 54 | 55 | $ cpplint --help 56 | 57 | Changes 58 | ------- 59 | 60 | The modifications in this fork are minor fixes and cosmetic changes, such as: 61 | 62 | * python 3 compatibility 63 | * more default file extensions 64 | * customizable file extensions with the --extensions argument 65 | * continuous integration on travis 66 | * support for recursive file discovery via the --recursive argument 67 | * support for excluding files via --exclude 68 | * JUnit XML output format 69 | * Overriding repository root auto-detection via --repository 70 | * Support ``#pragma once`` as an alternative to header include guards 71 | * ... and a few more (most of which are open PRs on upstream) 72 | 73 | 74 | Acknowledgements 75 | ---------------- 76 | 77 | Thanks to Google Inc. for open-sourcing their in-house tool. 78 | Thanks to maintainers of the fork 79 | 80 | * `tkruse `_ 81 | * `mattyclarkson `_ 82 | * `theandrewdavis `_ 83 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # X Memo Pool 2 | 3 | A memory pool implemented by C. 4 | 5 | ## Overview 6 | 7 | X Memo Pool is a lightweight and efficient memory management solution designed to optimize memory allocation and deallocation in C programs. It provides a pool-based approach to memory management, which can significantly improve performance in scenarios where frequent allocations of fixed-size blocks are required. 8 | 9 | > Note: Sharing a single pool across multiple threads is not recommended for thread safety. 10 | 11 | ## Features 12 | 13 | - Fast allocation and deallocation of fixed-size memory blocks 14 | - Automatic pool expansion when the current pool is exhausted 15 | - Zero-initialization of allocated blocks 16 | - Easy-to-use API with creation, allocation, freeing, and destruction functions 17 | - Debugging support with pool information printing 18 | 19 | ## Usage 20 | 21 | ### Creating a Pool 22 | 23 | To start using X Memo Pool, first create a pool handler for your data structure: 24 | 25 | ```c 26 | xmem_pool_handle xmem_create_pool(uint32_t block_size); 27 | ``` 28 | 29 | Example: 30 | 31 | ```c 32 | typedef struct { 33 | int id; 34 | char str[16]; 35 | } my_struct; 36 | 37 | xmem_pool_handle pool = xmem_create_pool(sizeof(my_struct)); 38 | if (!pool) { 39 | printf("Failed to create memory pool\n"); 40 | } 41 | ``` 42 | 43 | ### Allocating Memory 44 | 45 | To allocate a block from the pool: 46 | 47 | ```c 48 | char* xmem_alloc(xmem_pool_handle handle); 49 | ``` 50 | 51 | Example: 52 | 53 | ```c 54 | my_struct* data = (my_struct*)xmem_alloc(pool); 55 | if (!data) { 56 | printf("Failed to allocate memory from pool\n"); 57 | } 58 | ``` 59 | 60 | ### Freeing Memory 61 | 62 | To return a block to the pool: 63 | 64 | ```c 65 | int xmem_free(xmem_pool_handle handle, char* pointer); 66 | ``` 67 | 68 | Example: 69 | 70 | ```c 71 | int result = xmem_free(pool, (char*)data); 72 | if (!result) { 73 | printf("Failed to free memory\n"); 74 | } 75 | ``` 76 | 77 | ### Destroying the Pool 78 | 79 | To destroy the entire pool and free all associated resources: 80 | 81 | ```c 82 | void xmem_destroy_pool(xmem_pool_handle pool); 83 | ``` 84 | 85 | Example: 86 | 87 | ```c 88 | xmem_destroy_pool(pool); 89 | ``` 90 | 91 | ### Additional Functions 92 | 93 | For more detailed information about the API, please refer to the [xmempool.h](xmempool.h) header file. 94 | 95 | ## Performance 96 | 97 | To run performance tests: 98 | 99 | 1. Install dependencies: 100 | ``` 101 | npm install 102 | ``` 103 | 104 | 2. Run the performance script: 105 | ``` 106 | node perf.js 107 | ``` 108 | 109 | The performance report will be generated in the `./perf/report` directory. 110 | 111 | ## Contributing 112 | 113 | Contributions to X Memo Pool are welcome! Feel free to submit pull requests or open issues for bugs, feature requests, or improvements. 114 | 115 | ## License 116 | 117 | X Memo Pool is open-source software. Please refer to the [LICENSE](LICENSE) file for detailed licensing information. 118 | -------------------------------------------------------------------------------- /docs/html/folderopend.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/html/clipboard.js: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | The code below is based on the Doxygen Awesome project, see 4 | https://github.com/jothepro/doxygen-awesome-css 5 | 6 | MIT License 7 | 8 | Copyright (c) 2021 - 2022 jothepro 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | */ 29 | 30 | let clipboard_title = "Copy to clipboard" 31 | let clipboard_icon = `` 32 | let clipboard_successIcon = `` 33 | let clipboard_successDuration = 1000 34 | 35 | $(function() { 36 | if(navigator.clipboard) { 37 | const fragments = document.getElementsByClassName("fragment") 38 | for(const fragment of fragments) { 39 | const clipboard_div = document.createElement("div") 40 | clipboard_div.classList.add("clipboard") 41 | clipboard_div.innerHTML = clipboard_icon 42 | clipboard_div.title = clipboard_title 43 | $(clipboard_div).click(function() { 44 | const content = this.parentNode.cloneNode(true) 45 | // filter out line number and folded fragments from file listings 46 | content.querySelectorAll(".lineno, .ttc, .foldclosed").forEach((node) => { node.remove() }) 47 | let text = content.textContent 48 | // remove trailing newlines and trailing spaces from empty lines 49 | text = text.replace(/^\s*\n/gm,'\n').replace(/\n*$/,'') 50 | navigator.clipboard.writeText(text); 51 | this.classList.add("success") 52 | this.innerHTML = clipboard_successIcon 53 | window.setTimeout(() => { // switch back to normal icon after timeout 54 | this.classList.remove("success") 55 | this.innerHTML = clipboard_icon 56 | }, clipboard_successDuration); 57 | }) 58 | fragment.insertBefore(clipboard_div, fragment.firstChild) 59 | } 60 | } 61 | }) 62 | -------------------------------------------------------------------------------- /docs/html/folderopen.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | 11 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | OBJ = xmempool.o 2 | OBJ_D = xmempool.d 3 | TESTS = xmempool-test 4 | LIBNAME = xmempool 5 | PERF = perf 6 | 7 | CC = gcc 8 | OPTIMIZATION ?= -O2 9 | WARNINGS = -Wno-missing-field-initializers -Wno-int-conversion 10 | DEBUG ?= -g -ggdb 11 | 12 | REAL_CFLAGS = $(OPTIMIZATION) -fPIC $(CFLAGS) $(WARNINGS) $(DEBUG) -std=c99 13 | 14 | # Dynamic lib name 15 | DYLIBNAME = $(LIBNAME).so 16 | # Dynamic lib make command 17 | DYLIB_MAKE_CMD = $(CC) -shared -o $(DYLIBNAME) $(LDFLAGS) 18 | 19 | # Static lib name 20 | STLIBNAME = $(LIBNAME).a 21 | # Static lib make command 22 | STLIB_MAKE_CMD = ar rcs $(STLIBNAME) 23 | 24 | # Static debug lib name 25 | STLIBDNAME = $(LIBNAME)_d.a 26 | # Static debug lib make command 27 | STLIBD_MAKE_CMD = ar rcs $(STLIBDNAME) 28 | 29 | all: $(DYLIBNAME) perf_xmem perf_alloc test 30 | 31 | %.compdb_entry: %.c 32 | @echo " {" > $@ 33 | @echo " \"command\": \"$(CC) $(REAL_CFLAGS) -c $<\"," >> $@ 34 | @echo " \"directory\": \"$(CURDIR)\"," >> $@ 35 | @echo " \"file\": \"$<\"" >> $@ 36 | @echo " }," >> $@ 37 | 38 | COMPDB_ENTRIES = $(addsuffix .compdb_entry, $(basename xmempool.c test.c perf/alloc.c perf/xmem.c)) 39 | 40 | compile_commands.json: $(COMPDB_ENTRIES) 41 | @echo "[" > $@.tmp 42 | @cat $^ >> $@.tmp 43 | @sed '$$d' < $@.tmp > $@ 44 | @echo " }" >> $@ 45 | @echo "]" >> $@ 46 | @rm $(COMPDB_ENTRIES) 47 | @rm $@.tmp 48 | 49 | $(DYLIBNAME): $(OBJ) 50 | $(DYLIB_MAKE_CMD) $(OBJ) 51 | 52 | $(STLIBNAME): $(OBJ) 53 | $(STLIB_MAKE_CMD) $(OBJ) 54 | 55 | $(STLIBDNAME): $(OBJ_D) 56 | $(STLIBD_MAKE_CMD) $(OBJ_D) 57 | 58 | dynamic: $(DYLIBNAME) 59 | static: $(STLIBNAME) 60 | 61 | test_d: test.o $(STLIBDNAME) 62 | $(CC) -o $(TESTS)-d $(REAL_CFLAGS) $< -I. $(STLIBDNAME) 63 | 64 | test: test.o $(STLIBNAME) 65 | $(CC) -o $(TESTS) $(REAL_CFLAGS) $< -I. $(STLIBNAME) 66 | 67 | perf_xmem: perf/xmem.o $(STLIBNAME) 68 | $(CC) -o $(PERF)_xmem $(REAL_CFLAGS) $< -I. $(STLIBNAME) 69 | perf_alloc: perf/alloc.o $(STLIBNAME) 70 | $(CC) -o $(PERF)_alloc $(REAL_CFLAGS) $< -I. $(STLIBNAME) 71 | 72 | 73 | xmempool.d: xmempool.c 74 | 75 | xmempool.o: xmempool.c 76 | 77 | test.o: test.c 78 | 79 | perf/xmem.o: perf/xmem.c perf/common.h 80 | perf/alloc.o: perf/alloc.c perf/common.h 81 | 82 | node_modules: package.json 83 | npm install; rm package-lock.json # I HATE package-lock.json! 84 | 85 | .PYONY: clang-format cpplint 86 | clang-format: .clang-format-stamp 87 | .clang-format-stamp: xmempool.h xmempool.c test.c perf/xmem.c perf/alloc.c perf/common.h 88 | ./node_modules/.bin/clang-format -i --style=file $? 89 | touch $@ 90 | 91 | cpplint: .cpplint-stamp 92 | .cpplint-stamp: xmempool.h xmempool.c test.c perf/xmem.c perf/alloc.c perf/common.h 93 | ./tools/cpplint/cpplint.py $? 94 | touch $@ 95 | 96 | %.d: %.c 97 | $(CC) -c $(REAL_CFLAGS) -D XMEM_DBG $< -o $@ 98 | 99 | %.o: %.c 100 | $(CC) -c $(REAL_CFLAGS) $< -o $@ 101 | 102 | .PHONY: all test clean 103 | 104 | clean: 105 | $(RM) -rf *.o *.d $(DYLIBNAME) $(STLIBDNAME) $(STLIBNAME) $(TESTS) $(TESTS)-d perf/*.o perf_xmem perf_alloc 106 | 107 | # Doxygen documentation generation 108 | docs: 109 | doxygen Doxyfile 110 | 111 | .PHONY: docs 112 | -------------------------------------------------------------------------------- /tools/cpplint/setup.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | from setuptools import setup, Command 4 | from subprocess import check_call 5 | from distutils.spawn import find_executable 6 | import cpplint as cpplint 7 | 8 | class Cmd(Command): 9 | ''' 10 | Superclass for other commands to run via setup.py, declared in setup.cfg. 11 | These commands will auto-install setup_requires in a temporary folder. 12 | ''' 13 | user_options = [ 14 | ('executable', 'e', 'The executable to use for the command') 15 | ] 16 | 17 | def initialize_options(self): 18 | self.executable = find_executable(self.executable) 19 | 20 | def finalize_options(self): 21 | pass 22 | 23 | def execute(self, *k): 24 | check_call((self.executable,) + k) 25 | 26 | 27 | class Lint(Cmd): 28 | '''run with python setup.py lint''' 29 | description = 'Run linting of the code' 30 | user_options = Cmd.user_options + [ 31 | ('jobs', 'j', 'Use multiple processes to speed up the linting') 32 | ] 33 | executable = 'pylint' 34 | 35 | def run(self): 36 | self.execute('cpplint.py') 37 | 38 | # some pip versions bark on comments (e.g. on travis) 39 | def read_without_comments(filename): 40 | with open(filename) as f: 41 | return [line for line in f.read().splitlines() if not len(line) == 0 and not line.startswith('#')] 42 | 43 | test_required = read_without_comments('test-requirements') 44 | 45 | setup(name='cpplint', 46 | version=cpplint.__VERSION__, 47 | py_modules=['cpplint'], 48 | # generate platform specific start script 49 | entry_points={ 50 | 'console_scripts': [ 51 | 'cpplint = cpplint:main' 52 | ] 53 | }, 54 | install_requires=[], 55 | url='https://github.com/cpplint/cpplint', 56 | download_url='https://github.com/cpplint/cpplint', 57 | keywords=['lint', 'python', 'c++'], 58 | maintainer='cpplint Developers', 59 | maintainer_email='see_github@nospam.com', 60 | classifiers=['Programming Language :: Python', 61 | 'Programming Language :: Python :: 2', 62 | 'Programming Language :: Python :: 2.7', 63 | 'Programming Language :: Python :: 3', 64 | 'Programming Language :: Python :: 3.6', 65 | 'Programming Language :: Python :: 3.7', 66 | 'Programming Language :: Python :: 3.8', 67 | 'Programming Language :: C++', 68 | 'Development Status :: 5 - Production/Stable', 69 | 'Environment :: Console', 70 | 'Topic :: Software Development :: Quality Assurance', 71 | 'License :: Freely Distributable'], 72 | description='Automated checker to ensure C++ files follow Google\'s style guide', 73 | long_description=open('README.rst').read(), 74 | license='BSD-3-Clause', 75 | setup_requires=[ 76 | "pytest-runner" 77 | ], 78 | tests_require=test_required, 79 | # extras_require allow pip install .[dev] 80 | extras_require={ 81 | 'test': test_required, 82 | 'dev': read_without_comments('dev-requirements') + test_required 83 | }, 84 | cmdclass={ 85 | 'lint': Lint 86 | }) 87 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | # BasedOnStyle: Google 4 | AccessModifierOffset: -1 5 | AlignAfterOpenBracket: Align 6 | AlignConsecutiveAssignments: false 7 | AlignConsecutiveDeclarations: false 8 | AlignEscapedNewlines: Right 9 | AlignOperands: true 10 | AlignTrailingComments: true 11 | AllowAllParametersOfDeclarationOnNextLine: true 12 | AllowShortBlocksOnASingleLine: false 13 | AllowShortCaseLabelsOnASingleLine: false 14 | AllowShortFunctionsOnASingleLine: Inline 15 | AllowShortIfStatementsOnASingleLine: true 16 | AllowShortLoopsOnASingleLine: true 17 | AlwaysBreakAfterDefinitionReturnType: None 18 | AlwaysBreakAfterReturnType: None 19 | AlwaysBreakBeforeMultilineStrings: false 20 | AlwaysBreakTemplateDeclarations: true 21 | BinPackArguments: false 22 | BinPackParameters: false 23 | BraceWrapping: 24 | AfterClass: false 25 | AfterControlStatement: false 26 | AfterEnum: false 27 | AfterFunction: false 28 | AfterNamespace: false 29 | AfterObjCDeclaration: false 30 | AfterStruct: false 31 | AfterUnion: false 32 | AfterExternBlock: false 33 | BeforeCatch: false 34 | BeforeElse: false 35 | IndentBraces: false 36 | SplitEmptyFunction: true 37 | SplitEmptyRecord: true 38 | SplitEmptyNamespace: true 39 | BreakBeforeBinaryOperators: None 40 | BreakBeforeBraces: Attach 41 | BreakBeforeInheritanceComma: false 42 | BreakBeforeTernaryOperators: true 43 | BreakConstructorInitializersBeforeComma: false 44 | BreakConstructorInitializers: BeforeColon 45 | BreakAfterJavaFieldAnnotations: false 46 | BreakStringLiterals: true 47 | ColumnLimit: 80 48 | CommentPragmas: '^ IWYU pragma:' 49 | CompactNamespaces: false 50 | ConstructorInitializerAllOnOneLineOrOnePerLine: true 51 | ConstructorInitializerIndentWidth: 4 52 | ContinuationIndentWidth: 4 53 | Cpp11BracedListStyle: true 54 | DerivePointerAlignment: false 55 | DisableFormat: false 56 | ExperimentalAutoDetectBinPacking: false 57 | FixNamespaceComments: true 58 | ForEachMacros: 59 | - foreach 60 | - Q_FOREACH 61 | - BOOST_FOREACH 62 | IncludeBlocks: Preserve 63 | IncludeCategories: 64 | - Regex: '^' 65 | Priority: 2 66 | - Regex: '^<.*\.h>' 67 | Priority: 1 68 | - Regex: '^<.*' 69 | Priority: 2 70 | - Regex: '.*' 71 | Priority: 3 72 | IncludeIsMainRegex: '([-_](test|unittest))?$' 73 | IndentCaseLabels: true 74 | IndentPPDirectives: None 75 | IndentWidth: 2 76 | IndentWrappedFunctionNames: false 77 | JavaScriptQuotes: Leave 78 | JavaScriptWrapImports: true 79 | KeepEmptyLinesAtTheStartOfBlocks: false 80 | MacroBlockBegin: '' 81 | MacroBlockEnd: '' 82 | MaxEmptyLinesToKeep: 1 83 | NamespaceIndentation: None 84 | ObjCBlockIndentWidth: 2 85 | ObjCSpaceAfterProperty: false 86 | ObjCSpaceBeforeProtocolList: false 87 | PenaltyBreakAssignment: 2 88 | PenaltyBreakBeforeFirstCallParameter: 1 89 | PenaltyBreakComment: 300 90 | PenaltyBreakFirstLessLess: 120 91 | PenaltyBreakString: 1000 92 | PenaltyExcessCharacter: 1000000 93 | PenaltyReturnTypeOnItsOwnLine: 200 94 | PointerAlignment: Left 95 | ReflowComments: true 96 | SortIncludes: true 97 | SortUsingDeclarations: true 98 | SpaceAfterCStyleCast: false 99 | SpaceAfterTemplateKeyword: true 100 | SpaceBeforeAssignmentOperators: true 101 | SpaceBeforeParens: ControlStatements 102 | SpaceInEmptyParentheses: false 103 | SpacesBeforeTrailingComments: 2 104 | SpacesInAngles: false 105 | SpacesInContainerLiterals: true 106 | SpacesInCStyleCastParentheses: false 107 | SpacesInParentheses: false 108 | SpacesInSquareBrackets: false 109 | Standard: Auto 110 | TabWidth: 8 111 | UseTab: Never 112 | -------------------------------------------------------------------------------- /xmempool.h: -------------------------------------------------------------------------------- 1 | #ifndef XMEMPOOL_H_ 2 | #define XMEMPOOL_H_ 3 | 4 | /** 5 | * @file xmempool.h 6 | * @brief A memory pool implemented by C. 7 | * 8 | * @warning THREAD SAFETY NOTICE: 9 | * Individual pools are not thread-safe. For multi-threaded use, create separate 10 | * pools for each thread. 11 | */ 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #ifdef _MSC_VER 18 | #include "__stdint.h" 19 | #else 20 | #include 21 | #endif 22 | 23 | /** 24 | * @brief Major version number of xmempool 25 | */ 26 | #define XMEMPOOL_VERSION_MAJOR 1 27 | 28 | /** 29 | * @brief Minor version number of xmempool 30 | */ 31 | #define XMEMPOOL_VERSION_MINOR 1 32 | 33 | /** 34 | * @brief Patch version number of xmempool 35 | */ 36 | #define XMEMPOOL_VERSION_PATCH 2 37 | 38 | /** 39 | * @brief Version string of xmempool 40 | */ 41 | #define XMEMPOOL_VERSION_STRING "1.1.2" 42 | 43 | /** 44 | * @brief Handle type for memory pools 45 | * 46 | * This is a pointer to the first pool in the chain of memory pools. It's used 47 | * as an opaque handle to interact with the memory pool system. 48 | */ 49 | typedef char* xmem_pool_handle; 50 | 51 | /** 52 | * @brief Create a new memory pool 53 | * 54 | * This function creates the initial memory pool with the specified block size. 55 | * It allocates a large chunk of memory and divides it into fixed-size blocks. 56 | * Additional pools will be created automatically as needed. 57 | * 58 | * @param block_size Size of each block in the pool 59 | * @return Handle to the created pool, or NULL if creation failed 60 | */ 61 | extern xmem_pool_handle xmem_create_pool(uint32_t block_size); 62 | 63 | /** 64 | * @brief Destroy a memory pool and free all associated resources 65 | * 66 | * This function frees all memory associated with the pool, including all 67 | * chained pools and their blocks. It also recovers all block nodes used for 68 | * managing free blocks. 69 | * 70 | * @param pool Handle to the pool to be destroyed 71 | */ 72 | extern void xmem_destroy_pool(xmem_pool_handle pool); 73 | 74 | /** 75 | * @brief Allocate a block from the memory pool 76 | * 77 | * This function returns a pointer to a free block from the pool. If the current 78 | * pool is full, it automatically creates and chains a new pool. The allocated 79 | * block is always zero-initialized. 80 | * 81 | * @param handle Handle to the pool to allocate from 82 | * @return Pointer to the allocated block, or NULL if allocation failed 83 | */ 84 | extern char* xmem_alloc(xmem_pool_handle handle); 85 | 86 | /** 87 | * @brief Free a block back to the memory pool 88 | * 89 | * This function returns a block to the free list of the first pool in the 90 | * chain. It does not actually free memory, but makes the block available for 91 | * future allocations. 92 | * 93 | * @param handle Handle to the pool 94 | * @param pointer Pointer to the block to be freed 95 | * @return 1 if successful, 0 if failed (e.g., if no free block nodes are 96 | * available) 97 | */ 98 | extern int xmem_free(xmem_pool_handle handle, char* pointer); 99 | 100 | /** 101 | * @brief Print information about the memory pool 102 | * 103 | * This function prints detailed information about each pool in the chain, 104 | * including its size, block count, memory range, and number of free blocks. 105 | * 106 | * @param pool Handle to the pool 107 | */ 108 | extern void xmem_print_info(xmem_pool_handle pool); 109 | 110 | /** 111 | * @brief Clean up global resources used by xmempool 112 | * 113 | * This function frees all global resources used by the xmempool system, 114 | * particularly the memory used for managing block nodes. It should be called 115 | * when the xmempool system is no longer needed. 116 | */ 117 | extern void xmem_clean_up(); 118 | 119 | #ifdef __cplusplus 120 | } 121 | #endif 122 | 123 | #endif // XMEMPOOL_H_ 124 | -------------------------------------------------------------------------------- /tools/cpplint/samples/codelite-sample/src/pptable.h: -------------------------------------------------------------------------------- 1 | #ifndef PPTABLE_H 2 | #define PPTABLE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | 13 | #ifndef WXDLLIMPEXP_CL 14 | 15 | #ifdef WXMAKINGDLL_CL 16 | # define WXDLLIMPEXP_CL __declspec(dllexport) 17 | #elif defined(WXUSINGDLL_CL) 18 | # define WXDLLIMPEXP_CL __declspec(dllimport) 19 | #else // not making nor using DLL 20 | # define WXDLLIMPEXP_CL 21 | #endif 22 | 23 | #endif 24 | 25 | 26 | struct WXDLLIMPEXP_CL CLReplacement { 27 | bool is_compound; 28 | bool is_ok; 29 | std::string full_pattern; 30 | std::string searchFor; 31 | std::string replaceWith; 32 | void construct(const std::string& pattern, const std::string& replacement); 33 | }; 34 | 35 | typedef std::list CLReplacementList; 36 | 37 | /** 38 | * @brief perform search and replace using CL pattern 39 | * an example: 40 | * pattern=wx_dynamic_cast(%0, %1) 41 | * replacement=dynamic_cast<%0>(%1) 42 | * in=wx_dynamic_cast(wxApp*, ptr)->OnInit(); 43 | * 44 | * the expected result is: 45 | * dynamic_cast(ptr)->OnInit() 46 | * 47 | * It also supports simple search and replace 48 | */ 49 | bool CLReplacePattern(const wxString &in, const wxString& pattern, const wxString& replacement, wxString &output); 50 | 51 | /** 52 | * @brief perform search and replace using CL pattern 53 | * an example: 54 | * pattern=wx_dynamic_cast(%0, %1) 55 | * replacement=dynamic_cast<%0>(%1) 56 | * in=wx_dynamic_cast(wxApp*, ptr)->OnInit(); 57 | * 58 | * the expected result is: 59 | * dynamic_cast(ptr)->OnInit() 60 | * 61 | * It also supports simple search and replace 62 | */ 63 | bool CLReplacePatternA(const std::string& in, const CLReplacement& repl, std::string& outStr); 64 | 65 | /** 66 | * 67 | */ 68 | struct WXDLLIMPEXP_CL PPToken { 69 | enum { 70 | IsFunctionLike = 0x00000001, 71 | IsValid = 0x00000002, 72 | IsOverridable = 0x00000004 73 | }; 74 | 75 | int line; // line where found 76 | wxString name; // preprocessor name 77 | wxString replacement; // un processed replacement 78 | wxArrayString args; // for function like macros, contains the argument's names 79 | size_t flags; // PP token flags 80 | wxString fileName; 81 | 82 | PPToken() : line(0), flags(IsOverridable) 83 | {} 84 | 85 | ~PPToken() 86 | {} 87 | 88 | void expandOnce(const wxArrayString& initList); 89 | void processArgs(const wxString &argsList); 90 | wxString signature() const; 91 | void print(wxFFile &fp); 92 | static bool readInitList(const wxString &in, int from, wxString& initList, wxArrayString &initListArr); 93 | static bool readInitList(const std::string &in, size_t from, std::string& initList, std::vector &initListArr); 94 | void squeeze(); 95 | wxString fullname() const; 96 | 97 | }; 98 | 99 | class WXDLLIMPEXP_CL PPTable 100 | { 101 | std::map m_table; 102 | std::set m_namesUsed; 103 | 104 | public: 105 | static PPTable* Instance(); 106 | static void Release(); 107 | 108 | private: 109 | PPTable(); 110 | ~PPTable(); 111 | 112 | public: 113 | PPToken Token(const wxString &name); 114 | bool Contains(const wxString &name); 115 | void Add (const PPToken& token); 116 | void AddUsed(const wxString& name); 117 | void Print(wxFFile &fp); 118 | wxString Export(); 119 | void Clear(); 120 | void ClearNamesUsed(); 121 | void Squeeze(); 122 | 123 | const std::map& GetTable() const { 124 | return m_table; 125 | } 126 | 127 | const std::set& GetNamesUsed() const { 128 | return m_namesUsed; 129 | } 130 | }; 131 | #endif // PPTABLE_H 132 | -------------------------------------------------------------------------------- /docs/html/_r_e_a_d_m_e_8md.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | xmempool: README.md File Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 32 | 33 | 34 |
28 |
xmempool 1.1.2 29 |
30 |
A memory pool implemented by C.
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 | 64 | 65 |
69 |
70 | 71 | 72 |
73 |
74 |
75 |
76 |
77 |
Loading...
78 |
Searching...
79 |
No Matches
80 |
81 |
82 |
83 |
84 | 85 |
86 |
97 | 98 | 99 | -------------------------------------------------------------------------------- /docs/html/globals_type.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | xmempool: Globals 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 32 | 33 | 34 |
28 |
xmempool 1.1.2 29 |
30 |
A memory pool implemented by C.
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 |
60 |
61 | 66 | 67 |
71 |
72 | 73 | 74 |
75 |
76 |
77 |
78 |
79 |
Loading...
80 |
Searching...
81 |
No Matches
82 |
83 |
84 |
85 |
86 | 87 |
88 |
Here is a list of all typedefs with links to the files they belong to:
91 |
92 | 93 | 96 |
97 | 98 | 99 | -------------------------------------------------------------------------------- /docs/html/classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | xmempool: Data Structure Index 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 32 | 33 | 34 |
28 |
xmempool 1.0 29 |
30 |
A Simple Memory Pool Implementation
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 |
60 |
61 | 66 | 67 |
71 |
72 | 73 | 74 |
75 |
76 |
77 |
78 |
79 |
Loading...
80 |
Searching...
81 |
No Matches
82 |
83 |
84 |
85 |
86 | 87 |
88 |
Data Structure Index
89 |
90 |
91 | 92 |
93 |
94 |
X
95 |
xmem_pool
xmem_pool_block
96 |
97 |
98 | 99 | 102 |
103 | 104 | 105 | -------------------------------------------------------------------------------- /docs/html/files.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | xmempool: File List 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 32 | 33 | 34 |
28 |
xmempool 1.1.2 29 |
30 |
A memory pool implemented by C.
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 |
60 |
61 | 66 | 67 |
71 |
72 | 73 | 74 |
75 |
76 |
77 |
78 |
79 |
Loading...
80 |
Searching...
81 |
No Matches
82 |
83 |
84 |
85 |
86 | 87 |
88 |
File List
89 |
90 |
91 |
Here is a list of all files with brief descriptions:
92 | 93 | 94 |
 xmempool.hA memory pool implemented by C
95 |
96 |
97 | 98 | 101 |
102 | 103 | 104 | -------------------------------------------------------------------------------- /docs/html/globals_defs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | xmempool: Globals 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 32 | 33 | 34 |
28 |
xmempool 1.1.2 29 |
30 |
A memory pool implemented by C.
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 |
60 |
61 | 66 | 67 |
71 |
72 | 73 | 74 |
75 |
76 |
77 |
78 |
79 |
Loading...
80 |
Searching...
81 |
No Matches
82 |
83 |
84 |
85 |
86 | 87 |
88 |
Here is a list of all macros with links to the files they belong to:
94 |
95 | 96 | 99 |
100 | 101 | 102 | -------------------------------------------------------------------------------- /docs/html/globals_vars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | xmempool: Globals 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 32 | 33 | 34 |
28 |
xmempool 1.0 29 |
30 |
A Simple Memory Pool Implementation
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 |
60 |
61 | 66 | 67 |
71 |
72 | 73 | 74 |
75 |
76 |
77 |
78 |
79 |
Loading...
80 |
Searching...
81 |
No Matches
82 |
83 |
84 |
85 |
86 | 87 |
88 |
Here is a list of all variables with links to the files they belong to:
95 |
96 | 97 | 100 |
101 | 102 | 103 | -------------------------------------------------------------------------------- /docs/html/globals_func.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | xmempool: Globals 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 32 | 33 | 34 |
28 |
xmempool 1.1.2 29 |
30 |
A memory pool implemented by C.
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 |
60 |
61 | 66 | 67 |
71 |
72 | 73 | 74 |
75 |
76 |
77 |
78 |
79 |
Loading...
80 |
Searching...
81 |
No Matches
82 |
83 |
84 |
85 |
86 | 87 |
88 |
Here is a list of all functions with links to the files they belong to:
96 |
97 | 98 | 101 |
102 | 103 | 104 | -------------------------------------------------------------------------------- /docs/html/annotated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | xmempool: Data Structures 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 32 | 33 | 34 |
28 |
xmempool 1.0 29 |
30 |
A Simple Memory Pool Implementation
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 |
60 |
61 | 66 | 67 |
71 |
72 | 73 | 74 |
75 |
76 |
77 |
78 |
79 |
Loading...
80 |
Searching...
81 |
No Matches
82 |
83 |
84 |
85 |
86 | 87 |
88 |
Data Structures
89 |
90 |
91 |
Here are the data structures with brief descriptions:
92 | 93 | 94 | 95 |
 Cxmem_pool
 Cxmem_pool_blockXmempool - A Simple Memory Pool Implementation
96 |
97 |
98 | 99 | 102 |
103 | 104 | 105 | -------------------------------------------------------------------------------- /tools/cpplint/samples/boost-sample/headers_inspect.def: -------------------------------------------------------------------------------- 1 | src/inspect/* 2 | 1 3 | 3 4 | Done processing src/inspect/unnamed_namespace_check.hpp 5 | Total errors found: 40 6 | 7 | src/inspect/unnamed_namespace_check.hpp:0: No #ifndef header guard found, suggested CPP variable is: SAMPLES_BOOST_SAMPLE_SRC_INSPECT_UNNAMED_NAMESPACE_CHECK_HPP_ [build/header_guard] [5] 8 | src/inspect/unnamed_namespace_check.hpp:14: Do not use unnamed namespaces in header files. See https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces for more information. [build/namespaces_headers] [4] 9 | src/inspect/unnamed_namespace_check.hpp:18: At least two spaces is best between code and comments [whitespace/comments] [2] 10 | src/inspect/unnamed_namespace_check.hpp:19: Closing ) should be moved to the previous line [whitespace/parens] [2] 11 | src/inspect/unnamed_namespace_check.hpp:21: Anonymous namespace should be terminated with "// namespace" [readability/namespace] [5] 12 | src/inspect/unnamed_namespace_check.hpp:21: At least two spaces is best between code and comments [whitespace/comments] [2] 13 | src/inspect/unnamed_namespace_check.hpp:26: { should almost always be at the end of the previous line [whitespace/braces] [4] 14 | src/inspect/unnamed_namespace_check.hpp:27: Do not indent within a namespace [runtime/indentation_namespace] [4] 15 | src/inspect/unnamed_namespace_check.hpp:28: { should almost always be at the end of the previous line [whitespace/braces] [4] 16 | src/inspect/unnamed_namespace_check.hpp:29: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] 17 | src/inspect/unnamed_namespace_check.hpp:30: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] 18 | src/inspect/unnamed_namespace_check.hpp:30: { should almost always be at the end of the previous line [whitespace/braces] [4] 19 | src/inspect/unnamed_namespace_check.hpp:31: Extra space after ( in function call [whitespace/parens] [4] 20 | src/inspect/unnamed_namespace_check.hpp:31: Extra space before ) [whitespace/parens] [2] 21 | src/inspect/unnamed_namespace_check.hpp:32: At least two spaces is best between code and comments [whitespace/comments] [2] 22 | src/inspect/unnamed_namespace_check.hpp:32: Extra space after ( in function call [whitespace/parens] [4] 23 | src/inspect/unnamed_namespace_check.hpp:32: Extra space before ) [whitespace/parens] [2] 24 | src/inspect/unnamed_namespace_check.hpp:33: Extra space after ( in function call [whitespace/parens] [4] 25 | src/inspect/unnamed_namespace_check.hpp:33: Extra space before ) [whitespace/parens] [2] 26 | src/inspect/unnamed_namespace_check.hpp:34: At least two spaces is best between code and comments [whitespace/comments] [2] 27 | src/inspect/unnamed_namespace_check.hpp:34: Extra space after ( in function call [whitespace/parens] [4] 28 | src/inspect/unnamed_namespace_check.hpp:34: Extra space before ) [whitespace/parens] [2] 29 | src/inspect/unnamed_namespace_check.hpp:35: Extra space after ( in function call [whitespace/parens] [4] 30 | src/inspect/unnamed_namespace_check.hpp:35: Extra space before ) [whitespace/parens] [2] 31 | src/inspect/unnamed_namespace_check.hpp:36: Extra space after ( in function call [whitespace/parens] [4] 32 | src/inspect/unnamed_namespace_check.hpp:36: Extra space before ) [whitespace/parens] [2] 33 | src/inspect/unnamed_namespace_check.hpp:37: Extra space after ( in function call [whitespace/parens] [4] 34 | src/inspect/unnamed_namespace_check.hpp:37: Extra space before ) [whitespace/parens] [2] 35 | src/inspect/unnamed_namespace_check.hpp:38: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] 36 | src/inspect/unnamed_namespace_check.hpp:40: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] 37 | src/inspect/unnamed_namespace_check.hpp:44: { should almost always be at the end of the previous line [whitespace/braces] [4] 38 | src/inspect/unnamed_namespace_check.hpp:48: Lines should be <= 80 characters long [whitespace/line_length] [2] 39 | src/inspect/unnamed_namespace_check.hpp:49: Missing space before ( in for( [whitespace/parens] [5] 40 | src/inspect/unnamed_namespace_check.hpp:50: { should almost always be at the end of the previous line [whitespace/braces] [4] 41 | src/inspect/unnamed_namespace_check.hpp:54: Extra space after ( in function call [whitespace/parens] [4] 42 | src/inspect/unnamed_namespace_check.hpp:54: Extra space before ) [whitespace/parens] [2] 43 | src/inspect/unnamed_namespace_check.hpp:57: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] 44 | src/inspect/unnamed_namespace_check.hpp:59: At least two spaces is best between code and comments [whitespace/comments] [2] 45 | src/inspect/unnamed_namespace_check.hpp:60: At least two spaces is best between code and comments [whitespace/comments] [2] 46 | src/inspect/unnamed_namespace_check.hpp:51: Add #include for string [build/include_what_you_use] [4] 47 | 48 | -------------------------------------------------------------------------------- /docs/html/structxmem__pool__block-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | xmempool: Member List 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 32 | 33 | 34 |
28 |
xmempool 1.0 29 |
30 |
A Simple Memory Pool Implementation
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 | 64 | 65 |
69 |
70 | 71 | 72 |
73 |
74 |
75 |
76 |
77 |
Loading...
78 |
Searching...
79 |
No Matches
80 |
81 |
82 |
83 |
84 | 85 |
86 |
87 |
88 |
xmem_pool_block Member List
89 |
90 |
91 | 92 |

This is the complete list of members for xmem_pool_block, including all inherited members.

93 | 94 | 95 | 96 | 97 | 98 |
block_sizexmem_pool_block
is_block_startxmem_pool_block
nextxmem_pool_block
startxmem_pool_block
99 | 100 | 103 |
104 | 105 | 106 | -------------------------------------------------------------------------------- /docs/html/globals.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | xmempool: Globals 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 32 | 33 | 34 |
28 |
xmempool 1.1.2 29 |
30 |
A memory pool implemented by C.
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 |
60 |
61 | 66 | 67 |
71 |
72 | 73 | 74 |
75 |
76 |
77 |
78 |
79 |
Loading...
80 |
Searching...
81 |
No Matches
82 |
83 |
84 |
85 |
86 | 87 |
88 |
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
101 |
102 | 103 | 106 |
107 | 108 | 109 | -------------------------------------------------------------------------------- /docs/html/functions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | xmempool: Data Fields 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 32 | 33 | 34 |
28 |
xmempool 1.0 29 |
30 |
A Simple Memory Pool Implementation
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 |
60 |
61 | 66 | 67 |
71 |
72 | 73 | 74 |
75 |
76 |
77 |
78 |
79 |
Loading...
80 |
Searching...
81 |
No Matches
82 |
83 |
84 |
85 |
86 | 87 |
88 |
Here is a list of all struct and union fields with links to the structures/unions they belong to:
99 |
100 | 101 | 104 |
105 | 106 | 107 | -------------------------------------------------------------------------------- /docs/html/functions_vars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | xmempool: Data Fields - Variables 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 32 | 33 | 34 |
28 |
xmempool 1.0 29 |
30 |
A Simple Memory Pool Implementation
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 |
60 |
61 | 66 | 67 |
71 |
72 | 73 | 74 |
75 |
76 |
77 |
78 |
79 |
Loading...
80 |
Searching...
81 |
No Matches
82 |
83 |
84 |
85 |
86 | 87 |
88 |
Here is a list of all variables with links to the structures/unions they belong to:
99 |
100 | 101 | 104 |
105 | 106 | 107 | -------------------------------------------------------------------------------- /tools/cpplint/samples/boost-sample/src/tr1/c_policy.hpp: -------------------------------------------------------------------------------- 1 | // Copyright John Maddock 2008. 2 | // Use, modification and distribution are subject to the 3 | // Boost Software License, Version 1.0. (See accompanying file 4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | // 6 | #include 7 | #include 8 | 9 | namespace boost{ namespace math{ namespace policies{ 10 | 11 | template <> 12 | struct policy< 13 | domain_error, 14 | pole_error, 15 | overflow_error, 16 | evaluation_error, 17 | rounding_error, 18 | default_policy, default_policy, default_policy, default_policy, default_policy, default_policy> 19 | { 20 | public: 21 | typedef domain_error domain_error_type; 22 | typedef pole_error pole_error_type; 23 | typedef overflow_error overflow_error_type; 24 | typedef underflow_error underflow_error_type; 25 | typedef denorm_error denorm_error_type; 26 | typedef evaluation_error evaluation_error_type; 27 | typedef rounding_error rounding_error_type; 28 | typedef indeterminate_result_error<> indeterminate_result_error_type; 29 | #if BOOST_MATH_DIGITS10_POLICY == 0 30 | typedef digits2<> precision_type; 31 | #else 32 | typedef detail::precision, digits2<> >::type precision_type; 33 | #endif 34 | typedef promote_float<> promote_float_type; 35 | typedef promote_double<> promote_double_type; 36 | typedef discrete_quantile<> discrete_quantile_type; 37 | typedef assert_undefined<> assert_undefined_type; 38 | typedef max_series_iterations<> max_series_iterations_type; 39 | typedef max_root_iterations<> max_root_iterations_type; 40 | }; 41 | 42 | template <> 43 | struct policy< 44 | domain_error, 45 | pole_error, 46 | overflow_error, 47 | evaluation_error, 48 | rounding_error, 49 | detail::forwarding_arg1, 50 | detail::forwarding_arg2, 51 | default_policy, default_policy, default_policy, default_policy, default_policy, default_policy> 52 | { 53 | public: 54 | typedef domain_error domain_error_type; 55 | typedef pole_error pole_error_type; 56 | typedef overflow_error overflow_error_type; 57 | typedef underflow_error underflow_error_type; 58 | typedef denorm_error denorm_error_type; 59 | typedef evaluation_error evaluation_error_type; 60 | typedef rounding_error rounding_error_type; 61 | typedef indeterminate_result_error<> indeterminate_result_error_type; 62 | #if BOOST_MATH_DIGITS10_POLICY == 0 63 | typedef digits2<> precision_type; 64 | #else 65 | typedef detail::precision, digits2<> >::type precision_type; 66 | #endif 67 | typedef promote_float promote_float_type; 68 | typedef promote_double promote_double_type; 69 | typedef discrete_quantile<> discrete_quantile_type; 70 | typedef assert_undefined<> assert_undefined_type; 71 | typedef max_series_iterations<> max_series_iterations_type; 72 | typedef max_root_iterations<> max_root_iterations_type; 73 | }; 74 | 75 | template <> 76 | struct normalise, pole_error, overflow_error, evaluation_error, rounding_error >, 77 | promote_float, 78 | promote_double, 79 | discrete_quantile<>, 80 | assert_undefined<>, 81 | default_policy, 82 | default_policy, 83 | default_policy, 84 | default_policy, 85 | default_policy, 86 | default_policy, 87 | default_policy> 88 | { 89 | typedef policy, pole_error, overflow_error, evaluation_error, rounding_error, detail::forwarding_arg1, detail::forwarding_arg2> type; 90 | }; 91 | 92 | template <> 93 | struct normalise, pole_error, overflow_error, evaluation_error, rounding_error, detail::forwarding_arg1, detail::forwarding_arg2 >, 94 | promote_float, 95 | promote_double, 96 | discrete_quantile<>, 97 | assert_undefined<>, 98 | default_policy, 99 | default_policy, 100 | default_policy, 101 | default_policy, 102 | default_policy, 103 | default_policy, 104 | default_policy> 105 | { 106 | typedef policy, pole_error, overflow_error, evaluation_error, rounding_error, detail::forwarding_arg1, detail::forwarding_arg2> type; 107 | }; 108 | 109 | }}} // namespaces 110 | 111 | namespace c_policies{ 112 | 113 | using boost::math::policies::policy; 114 | using boost::math::policies::errno_on_error; 115 | using boost::math::policies::domain_error; 116 | using boost::math::policies::pole_error; 117 | using boost::math::policies::overflow_error; 118 | using boost::math::policies::rounding_error; 119 | using boost::math::policies::evaluation_error; 120 | 121 | typedef policy< 122 | domain_error, 123 | pole_error, 124 | overflow_error, 125 | evaluation_error, 126 | rounding_error 127 | > c_policy; 128 | 129 | BOOST_MATH_DECLARE_SPECIAL_FUNCTIONS(c_policy) 130 | 131 | } 132 | -------------------------------------------------------------------------------- /tools/cpplint/changelog.rst: -------------------------------------------------------------------------------- 1 | Changelog 2 | ========= 3 | 4 | 1.5.4 (2020-08-18) 5 | ----- 6 | 7 | * Fix google#166, Allow space before C++11 attributes 8 | 9 | 1.5.3 (2020-07-20) 10 | ----- 11 | 12 | * Fix #156: sed/gsed output parameter rejected 13 | * Fix #156: sed/gsed output without other stdout information 14 | * improvements to regression tests 15 | 16 | 1.5.2 (2020-06-24) 17 | ----- 18 | 19 | * Fix #83, output formats "sed" and "gsed" to auto-fix some issues 20 | * Fix #92, new category "build/namespaces_headers" for unnamed namespaces in header file 21 | * Sort list of files before processing 22 | * Fix #144 Falso positive for indent when using QT macros "signals" and "slots" 23 | * Fix #76 Parsing of class decorators that also use digits 24 | * Fix #139 Add message "Relative paths like . and .. are not allowed" 25 | 26 | 1.5.1 (2020-06-05) 27 | ----- 28 | 29 | * Revert #43 behavior change for include order from 1.5.0, and hide it behind command-line-flag `--includeorder=standardcfirst`. 30 | It turns out there is no easy objective way to tell c system headers from certain c++ library headers, and Google cpplint intentionally classifies some C++ header includes as C system header for simplicity. 31 | * Libraries considered as C system headers using --includeorder=standardcfirst now also includes linux-specifc headers (glibc-devel, glibc-kernheaders, linux-libc-dev). 32 | 33 | 34 | 1.5.0 (2020-05-31) 35 | ----- 36 | 37 | * Fix #43 false positives in header include order by checking includes against a list of c headers. 38 | Since this interprets certain include lines different than before, output about header include order changes. 39 | 40 | 1.4.6 (2020-05-31) 41 | ----- 42 | 43 | * Fix #135: allow 'if constexpr' in readability/braces. 44 | * Fix runtime warning: Close files after reading contents 45 | 46 | 1.4.5 (2020-01-13) 47 | ----- 48 | 49 | * Avoid false positive for [build/include_what_you_use] in case of `foo.set` and `foo->set` usage. 50 | * Avoid false positive for [build/include_what_you_use] in case of `map` is user defined function 51 | * Escape backslashes in pydoc strings to get rid of DeprecationWarning. 52 | * Fix false positive "should include its header" for 3rd party headers 53 | * Add support for c++17 tuple destructuring 54 | * fix #123: Inconsistent behavior of --headers and --extensions 55 | * Fix #114: --exclude not working recursively 56 | * fix #112, identifying of copy constructors should allow combinations of volatile and const 57 | 58 | 1.4.4 (2019-02-25) 59 | ----- 60 | 61 | Another cleanup release 62 | 63 | * NOBUG: fix unit/cli tests for source release 64 | * NOBUG: reduce diff to upstream by intentionally using deprecated functions where upstream uses them 65 | * add `--version` command (https://github.com/cpplint/cpplint/issues/27) 66 | 67 | 1.4.3 (2019-02-18) 68 | ----- 69 | 70 | * Revert "Fix the `build/endif_comment` check", same as reverted in upstream 71 | 72 | 1.4.2 (2019-02-17) 73 | ----- 74 | 75 | * Cleanup release, fixes further issues with tests and source distribution 76 | 77 | 1.4.1 (2019-02-17) 78 | ----- 79 | 80 | * Cleanup release, only adds test support files to source dist 81 | 82 | 1.4.0 (2019-02-17) 83 | ----- 84 | 85 | * Incorporate cpplint updates from google (e5d807c6a0d, 2018-05-03) 86 | * Fix the `build/endif_comment` check (https://github.com/google/styleguide/pull/169) 87 | * Teach the explicit constructor check about constexpr (#56) 88 | * Changed vs7 output format (#57) 89 | * Remove presubmit check for DISALLOW_* macros (#54) 90 | * add `--quiet` flag as in upstream (https://github.com/google/styleguide/pull/293) 91 | * support `--root` argument to run in different folder (https://github.com/google/styleguide/pull/291) 92 | * Fix 16bit Unicode issue (https://github.com/google/styleguide/issues/337) 93 | 94 | 1.3.0 (2016-07-12) 95 | ----- 96 | 97 | * Incorporate cpplint updates from google (6d3a7d8a2, 2016-07-14) 98 | * Add --headers flag to choose which extensions are header files. 99 | * Add regression testsing. 100 | 101 | 1.2.2 (2016-04-07) 102 | ----- 103 | 104 | * Fixes bug causing RValue detection with namespaces to fail. 105 | 106 | 1.2.1 (2016-03-19) 107 | ----- 108 | 109 | * Fixes error in setup.py. 110 | 111 | 1.2.0 (2016-03-19) 112 | ----- 113 | 114 | * Adds `.cu` and `.cuh` as supported file extensions by default. 115 | * Moves the warning "Include the directory when naming .h files" from the `build/include` category to the `build/include_subdir` category. 116 | 117 | 1.1.0 (2016-02-24) 118 | ----- 119 | 120 | * Adds quiet option to suppress non error-related output. 121 | 122 | 1.0.1 (2016-02-12) 123 | ----- 124 | 125 | * Updates PyPi README. 126 | 127 | 1.0.0 (2016-02-03) 128 | ----- 129 | 130 | * Fixes a --repository flag bug. 131 | 132 | 0.0.9 (2016-01-23) 133 | ----- 134 | 135 | * Adds the --exclude flag to exclude files from being linted. 136 | 137 | 0.0.8 (2016-01-18) 138 | ----- 139 | 140 | * Adds the --repository flag to set the location of the project root for header guard calculations. 141 | * Adds support for ``#pragma once`` as an alternative to header include guards. 142 | 143 | 0.0.7 (2016-01-07) 144 | ----- 145 | 146 | * Fixes a Windows include guard bug. 147 | * Adds escaping and more detail to JUnit XML output. 148 | 149 | 0.0.6 (2015-12-15) 150 | ----- 151 | 152 | * Adds the --recursive flag. 153 | * Adds JUnit XML output. 154 | 155 | 0.0.5 (2015-01-04) 156 | ----- 157 | 158 | * Maintenance release, undoes earlier project folder structure changes to remain as true to upstream as possible. 159 | 160 | 0.0.4 (2015-01-04) 161 | ----- 162 | 163 | * Merged with upstream revision r141 (2014-12-04) 164 | * This includes many new checks, see commit messages for details 165 | * This also reverts some renaming of files, to stay close to the original project 166 | 167 | 168 | 0.0.3 (2012-11-24) 169 | ----- 170 | 171 | * python 3 compatibility 172 | 173 | 0.0.2 (2012-11-06) 174 | ----- 175 | 176 | * fixed and extended allowed extensions 177 | 178 | 0.0.1 (2012-10-13) 179 | ----- 180 | 181 | * import from googlecode, added setup.py 182 | * imported revision r83 (2012-05-11) 183 | -------------------------------------------------------------------------------- /docs/html/structxmem__pool-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | xmempool: Member List 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 32 | 33 | 34 |
28 |
xmempool 1.0 29 |
30 |
A Simple Memory Pool Implementation
31 |
35 |
36 | 37 | 38 | 43 | 48 | 49 | 50 | 58 | 59 | 64 | 65 |
69 |
70 | 71 | 72 |
73 |
74 |
75 |
76 |
77 |
Loading...
78 |
Searching...
79 |
No Matches
80 |
81 |
82 |
83 |
84 | 85 |
86 |
87 |
88 |
xmem_pool Member List
89 |
90 |
91 | 92 |

This is the complete list of members for xmem_pool, including all inherited members.

93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 |
block_countxmem_pool
block_sizexmem_pool
endxmem_pool
free_blocksxmem_pool
free_blocks_tailxmem_pool
nextxmem_pool
next_alloc_lengthxmem_pool
startxmem_pool
103 | 104 | 107 |
108 | 109 | 110 | -------------------------------------------------------------------------------- /docs/html/resize.js: -------------------------------------------------------------------------------- 1 | /* 2 | @licstart The following is the entire license notice for the JavaScript code in this file. 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (C) 1997-2020 by Dimitri van Heesch 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 9 | and associated documentation files (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 11 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all copies or 15 | substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 18 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | @licend The above is the entire license notice for the JavaScript code in this file 24 | */ 25 | 26 | function initResizable(treeview) { 27 | let sidenav,navtree,content,header,footer,barWidth=6; 28 | const RESIZE_COOKIE_NAME = ''+'width'; 29 | 30 | function resizeWidth() { 31 | const sidenavWidth = $(sidenav).outerWidth(); 32 | content.css({marginLeft:parseInt(sidenavWidth)+"px"}); 33 | if (typeof page_layout!=='undefined' && page_layout==1) { 34 | footer.css({marginLeft:parseInt(sidenavWidth)+"px"}); 35 | } 36 | Cookie.writeSetting(RESIZE_COOKIE_NAME,sidenavWidth-barWidth); 37 | } 38 | 39 | function restoreWidth(navWidth) { 40 | content.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); 41 | if (typeof page_layout!=='undefined' && page_layout==1) { 42 | footer.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); 43 | } 44 | sidenav.css({width:navWidth + "px"}); 45 | } 46 | 47 | function resizeHeight(treeview) { 48 | const headerHeight = header.outerHeight(); 49 | const windowHeight = $(window).height(); 50 | let contentHeight; 51 | if (treeview) 52 | { 53 | const footerHeight = footer.outerHeight(); 54 | let navtreeHeight,sideNavHeight; 55 | if (typeof page_layout==='undefined' || page_layout==0) { /* DISABLE_INDEX=NO */ 56 | contentHeight = windowHeight - headerHeight - footerHeight; 57 | navtreeHeight = contentHeight; 58 | sideNavHeight = contentHeight; 59 | } else if (page_layout==1) { /* DISABLE_INDEX=YES */ 60 | contentHeight = windowHeight - footerHeight; 61 | navtreeHeight = windowHeight - headerHeight; 62 | sideNavHeight = windowHeight; 63 | } 64 | navtree.css({height:navtreeHeight + "px"}); 65 | sidenav.css({height:sideNavHeight + "px"}); 66 | } 67 | else 68 | { 69 | contentHeight = windowHeight - headerHeight; 70 | } 71 | content.css({height:contentHeight + "px"}); 72 | if (location.hash.slice(1)) { 73 | (document.getElementById(location.hash.slice(1))||document.body).scrollIntoView(); 74 | } 75 | } 76 | 77 | function collapseExpand() { 78 | let newWidth; 79 | if (sidenav.width()>0) { 80 | newWidth=0; 81 | } else { 82 | const width = Cookie.readSetting(RESIZE_COOKIE_NAME,250); 83 | newWidth = (width>250 && width<$(window).width()) ? width : 250; 84 | } 85 | restoreWidth(newWidth); 86 | const sidenavWidth = $(sidenav).outerWidth(); 87 | Cookie.writeSetting(RESIZE_COOKIE_NAME,sidenavWidth-barWidth); 88 | } 89 | 90 | header = $("#top"); 91 | content = $("#doc-content"); 92 | footer = $("#nav-path"); 93 | sidenav = $("#side-nav"); 94 | if (!treeview) { 95 | // title = $("#titlearea"); 96 | // titleH = $(title).height(); 97 | // let animating = false; 98 | // content.on("scroll", function() { 99 | // slideOpts = { duration: 200, 100 | // step: function() { 101 | // contentHeight = $(window).height() - header.outerHeight(); 102 | // content.css({ height : contentHeight + "px" }); 103 | // }, 104 | // done: function() { animating=false; } 105 | // }; 106 | // if (content.scrollTop()>titleH && title.css('display')!='none' && !animating) { 107 | // title.slideUp(slideOpts); 108 | // animating=true; 109 | // } else if (content.scrollTop()<=titleH && title.css('display')=='none' && !animating) { 110 | // title.slideDown(slideOpts); 111 | // animating=true; 112 | // } 113 | // }); 114 | } else { 115 | navtree = $("#nav-tree"); 116 | $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } }); 117 | $(sidenav).resizable({ minWidth: 0 }); 118 | } 119 | $(window).resize(function() { resizeHeight(treeview); }); 120 | if (treeview) 121 | { 122 | const device = navigator.userAgent.toLowerCase(); 123 | const touch_device = device.match(/(iphone|ipod|ipad|android)/); 124 | if (touch_device) { /* wider split bar for touch only devices */ 125 | $(sidenav).css({ paddingRight:'20px' }); 126 | $('.ui-resizable-e').css({ width:'20px' }); 127 | $('#nav-sync').css({ right:'34px' }); 128 | barWidth=20; 129 | } 130 | const width = Cookie.readSetting(RESIZE_COOKIE_NAME,250); 131 | if (width) { restoreWidth(width); } else { resizeWidth(); } 132 | } 133 | resizeHeight(treeview); 134 | const url = location.href; 135 | const i=url.indexOf("#"); 136 | if (i>=0) window.location.hash=url.substr(i); 137 | const _preventDefault = function(evt) { evt.preventDefault(); }; 138 | if (treeview) 139 | { 140 | $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); 141 | $(".ui-resizable-handle").dblclick(collapseExpand); 142 | // workaround for firefox 143 | $("body").css({overflow: "hidden"}); 144 | } 145 | $(window).on('load',function() { resizeHeight(treeview); }); 146 | } 147 | /* @license-end */ 148 | -------------------------------------------------------------------------------- /docs/html/menu.js: -------------------------------------------------------------------------------- 1 | /* 2 | @licstart The following is the entire license notice for the JavaScript code in this file. 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (C) 1997-2020 by Dimitri van Heesch 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 9 | and associated documentation files (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 11 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all copies or 15 | substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 18 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | @licend The above is the entire license notice for the JavaScript code in this file 24 | */ 25 | function initMenu(relPath,searchEnabled,serverSide,searchPage,search,treeview) { 26 | function makeTree(data,relPath) { 27 | let result=''; 28 | if ('children' in data) { 29 | result+='
    '; 30 | for (let i in data.children) { 31 | let url; 32 | const link = data.children[i].url; 33 | if (link.substring(0,1)=='^') { 34 | url = link.substring(1); 35 | } else { 36 | url = relPath+link; 37 | } 38 | result+='
  • '+ 39 | data.children[i].text+''+ 40 | makeTree(data.children[i],relPath)+'
  • '; 41 | } 42 | result+='
'; 43 | } 44 | return result; 45 | } 46 | let searchBoxHtml; 47 | if (searchEnabled) { 48 | if (serverSide) { 49 | searchBoxHtml='
'+ 50 | '
'+ 51 | '
 '+ 53 | ''+ 56 | '
'+ 57 | '
'+ 58 | '
'+ 59 | '
'; 60 | } else { 61 | searchBoxHtml='
'+ 62 | ''+ 63 | ' '+ 65 | ''+ 69 | ''+ 70 | ''+ 72 | ''+ 74 | ''+ 75 | '
'; 76 | } 77 | } 78 | 79 | $('#main-nav').before('
'+ 80 | ''+ 83 | ''+ 84 | '
'); 85 | $('#main-nav').append(makeTree(menudata,relPath)); 86 | $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); 87 | if (searchBoxHtml) { 88 | $('#main-menu').append('
  • '); 89 | } 90 | const $mainMenuState = $('#main-menu-state'); 91 | let prevWidth = 0; 92 | if ($mainMenuState.length) { 93 | const initResizableIfExists = function() { 94 | if (typeof initResizable==='function') initResizable(treeview); 95 | } 96 | // animate mobile menu 97 | $mainMenuState.change(function() { 98 | const $menu = $('#main-menu'); 99 | let options = { duration: 250, step: initResizableIfExists }; 100 | if (this.checked) { 101 | options['complete'] = () => $menu.css('display', 'block'); 102 | $menu.hide().slideDown(options); 103 | } else { 104 | options['complete'] = () => $menu.css('display', 'none'); 105 | $menu.show().slideUp(options); 106 | } 107 | }); 108 | // set default menu visibility 109 | const resetState = function() { 110 | const $menu = $('#main-menu'); 111 | const newWidth = $(window).outerWidth(); 112 | if (newWidth!=prevWidth) { 113 | if ($(window).outerWidth()<768) { 114 | $mainMenuState.prop('checked',false); $menu.hide(); 115 | $('#searchBoxPos1').html(searchBoxHtml); 116 | $('#searchBoxPos2').hide(); 117 | } else { 118 | $menu.show(); 119 | $('#searchBoxPos1').empty(); 120 | $('#searchBoxPos2').html(searchBoxHtml); 121 | $('#searchBoxPos2').show(); 122 | } 123 | if (typeof searchBox!=='undefined') { 124 | searchBox.CloseResultsWindow(); 125 | } 126 | prevWidth = newWidth; 127 | } 128 | } 129 | $(window).ready(function() { resetState(); initResizableIfExists(); }); 130 | $(window).resize(resetState); 131 | } 132 | $('#main-menu').smartmenus(); 133 | } 134 | /* @license-end */ 135 | --------------------------------------------------------------------------------