summaryrefslogtreecommitdiffstats
path: root/test/unit/bitmap.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Remove BITMAP_USE_TREE."Jason Evans2017-04-191-0/+16
| | | | | | | | | Some systems use a native 64 KiB page size, which means that the bitmap for the smallest size class can be 8192 bits, not just 512 bits as when the page size is 4 KiB. Linear search in bitmap_{sfu,ffu}() is unacceptably slow for such large bitmaps. This reverts commit 7c00f04ff40a34627e31488d02ff1081c749c7ba.
* Remove BITMAP_USE_TREE.Jason Evans2017-03-271-16/+0
| | | | | | | | | | Remove tree-structured bitmap support, in order to reduce complexity and ease maintenance. No bitmaps larger than 512 bits have been necessary since before 4.0.0, and there is no current plan that would increase maximum bitmap size. Although tree-structured bitmaps were used on 32-bit platforms prior to this change, the overall benefits were questionable (higher metadata overhead, higher bitmap modification cost, marginally lower search cost).
* Fix bitmap_ffu() to work with 3+ levels.Jason Evans2017-03-271-0/+27
|
* Fix BITMAP_USE_TREE version of bitmap_ffu().Jason Evans2017-03-261-5/+35
| | | | | | | | | This fixes an extent searching regression on 32-bit systems, caused by the initial bitmap_ffu() implementation in c8021d01f6efe14dc1bd200021a815638063cb5f (Implement bitmap_ffu(), which finds the first unset bit.), as first used in 5d33233a5e6601902df7cddd8cc8aa0b135c77b2 (Use a bitmap in extents_t to speed up search.).
* Implement bitmap_ffu(), which finds the first unset bit.Jason Evans2017-03-251-12/+47
|
* Replace tabs following #define with spaces.Jason Evans2017-01-211-7/+7
| | | | This resolves #564.
* Remove extraneous parens around return arguments.Jason Evans2017-01-211-3/+3
| | | | This resolves #540.
* Update brace style.Jason Evans2017-01-211-30/+21
| | | | | | | Add braces around single-line blocks, and remove line breaks before function-opening braces. This resolves #537.
* Remove leading blank lines from function bodies.Jason Evans2017-01-131-2/+0
| | | | This resolves #535.
* Implement BITMAP_INFO_INITIALIZER(nbits).Jason Evans2016-05-131-109/+296
| | | | This allows static initialization of bitmap_info_t structures.
* Refactor out signed/unsigned comparisons.Jason Evans2016-03-151-2/+2
|
* Miscellaneous bitmap refactoring.Jason Evans2016-02-261-9/+13
|
* Avoid function prototype incompatibilities.Jason Evans2015-07-101-4/+4
| | | | | | | | | Add various function attributes to the exported functions to give the compiler more information to work with during optimization, and also specify throw() when compiling with C++ on Linux, in order to adequately match what __THROW does in glibc. This resolves #237.
* Implement compile-time bitmap size computation.Jason Evans2014-09-281-11/+5
|
* Refactor tests.Jason Evans2013-12-091-33/+47
| | | | | | | Refactor tests to use explicit testing assertions, rather than diff'ing test output. This makes the test code a bit shorter, more explicitly encodes testing intent, and makes test failure diagnosis more straightforward.
* Refactor to support more varied testing.Jason Evans2013-12-041-0/+151
Refactor the test harness to support three types of tests: - unit: White box unit tests. These tests have full access to all internal jemalloc library symbols. Though in actuality all symbols are prefixed by jet_, macro-based name mangling abstracts this away from test code. - integration: Black box integration tests. These tests link with the installable shared jemalloc library, and with the exception of some utility code and configure-generated macro definitions, they have no access to jemalloc internals. - stress: Black box stress tests. These tests link with the installable shared jemalloc library, as well as with an internal allocator with symbols prefixed by jet_ (same as for unit tests) that can be used to allocate data structures that are internal to the test code. Move existing tests into test/{unit,integration}/ as appropriate. Split out internal parts of jemalloc_defs.h.in and put them in jemalloc_internal_defs.h.in. This reduces internals exposure to applications that #include <jemalloc/jemalloc.h>. Refactor jemalloc.h header generation so that a single header file results, and the prototypes can be used to generate jet_ prototypes for tests. Split jemalloc.h.in into multiple parts (jemalloc_defs.h.in, jemalloc_macros.h.in, jemalloc_protos.h.in, jemalloc_mangle.h.in) and use a shell script to generate a unified jemalloc.h at configure time. Change the default private namespace prefix from "" to "je_". Add missing private namespace mangling. Remove hard-coded private_namespace.h. Instead generate it and private_unnamespace.h from private_symbols.txt. Use similar logic for public symbols, which aids in name mangling for jet_ symbols. Add test_warn() and test_fail(). Replace existing exit(1) calls with test_fail() calls.