diff options
author | Jason Evans <jasone@canonware.com> | 2011-03-22 16:00:56 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2011-03-22 16:00:56 (GMT) |
commit | 47e57f9bdadfaf999c9dea5d126edf3a4f1b2995 (patch) | |
tree | f87b3e6aa154788b872bd585ab88f8e602c14369 /jemalloc/test | |
parent | 1dcb4f86b23a5760f5a717ace716360b63b33fad (diff) | |
download | jemalloc-47e57f9bdadfaf999c9dea5d126edf3a4f1b2995.zip jemalloc-47e57f9bdadfaf999c9dea5d126edf3a4f1b2995.tar.gz jemalloc-47e57f9bdadfaf999c9dea5d126edf3a4f1b2995.tar.bz2 |
Avoid overflow in arena_run_regind().
Fix a regression due to:
Remove an arena_bin_run_size_calc() constraint.
2a6f2af6e446a98a635caadd281a23ca09a491cb
The removed constraint required that small run headers fit in one page,
which indirectly limited runs such that they would not cause overflow in
arena_run_regind(). Add an explicit constraint to
arena_bin_run_size_calc() based on the largest number of regions that
arena_run_regind() can handle (2^11 as currently configured).
Diffstat (limited to 'jemalloc/test')
-rw-r--r-- | jemalloc/test/bitmap.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/jemalloc/test/bitmap.c b/jemalloc/test/bitmap.c index 7a017c8..adfaacf 100644 --- a/jemalloc/test/bitmap.c +++ b/jemalloc/test/bitmap.c @@ -13,7 +13,11 @@ */ #include "../src/bitmap.c" -#define MAXBITS 4500 +#if (LG_BITMAP_MAXBITS > 12) +# define MAXBITS 4500 +#else +# define MAXBITS (1U << LG_BITMAP_MAXBITS) +#endif static void test_bitmap_size(void) |