diff --git a/.gitignore b/.gitignore index e362568..5645580 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,5 @@ autom4te.cache include/config.h* missing stamp-h1 +.deps tests/test_bitmapalloc \ No newline at end of file diff --git a/tests/test_bitmapalloc.c b/tests/test_bitmapalloc.c index a0abbaa..329ecb7 100644 --- a/tests/test_bitmapalloc.c +++ b/tests/test_bitmapalloc.c @@ -149,12 +149,13 @@ int main(int argc, char **args) test_heap(256, 1, 128, 1); test_heap(256, 1, 4, 1); - for(int bs = 1; bs <= 32; bs++) + for(int bs = 1; bs <= 32; bs *= 2) { + unsigned long heap_size = (1 << llog2(bs)) * 256; unsigned long n = (8 * sizeof(unsigned long)) - 1 - __builtin_clzl((unsigned long) bs); - for(int bits = 1; bits <= (8 * sizeof(unsigned long)) && (2 * bits) < (8 * (1 << n)); bits <<= 1) + for(int bits = 1; bits < (8 * sizeof(unsigned long)) && (2 * bits) < (8 * (1 << n)); bits <<= 1) { - test_heap(1024, bs, bits, 0); + test_heap(heap_size, bs, bits, 0); } } } \ No newline at end of file