diff options
author | Jason Evans <jasone@canonware.com> | 2017-02-26 20:48:43 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2017-02-27 19:17:47 (GMT) |
commit | 079b8bee37ddd35e25c0cf7ac9241520290fa66c (patch) | |
tree | 866be127997d88ba2192dad5a65236dde38f18b8 | |
parent | d727596bcbd3f2d6b2af1e21cf19210ac236f8df (diff) | |
download | jemalloc-079b8bee37ddd35e25c0cf7ac9241520290fa66c.zip jemalloc-079b8bee37ddd35e25c0cf7ac9241520290fa66c.tar.gz jemalloc-079b8bee37ddd35e25c0cf7ac9241520290fa66c.tar.bz2 |
Tidy up extent quantization.
Remove obsolete unit test scaffolding for extent quantization. Remove
redundant assertions. Add an assertion to
extents_first_best_fit_locked() that should help prevent aligned
allocation regressions.
-rw-r--r-- | include/jemalloc/internal/extent_externs.h | 4 | ||||
-rw-r--r-- | src/extent.c | 26 |
2 files changed, 5 insertions, 25 deletions
diff --git a/include/jemalloc/internal/extent_externs.h b/include/jemalloc/internal/extent_externs.h index d971ec3..f5efed0 100644 --- a/include/jemalloc/internal/extent_externs.h +++ b/include/jemalloc/internal/extent_externs.h @@ -11,10 +11,6 @@ extent_hooks_t *extent_hooks_get(arena_t *arena); extent_hooks_t *extent_hooks_set(arena_t *arena, extent_hooks_t *extent_hooks); #ifdef JEMALLOC_JET -typedef size_t (extent_size_quantize_t)(size_t); -extern extent_size_quantize_t *extent_size_quantize_floor; -extern extent_size_quantize_t *extent_size_quantize_ceil; -#else size_t extent_size_quantize_floor(size_t size); size_t extent_size_quantize_ceil(size_t size); #endif diff --git a/src/extent.c b/src/extent.c index afc6006..09990aa 100644 --- a/src/extent.c +++ b/src/extent.c @@ -118,9 +118,8 @@ extent_hooks_assure_initialized(arena_t *arena, } } -#ifdef JEMALLOC_JET -#undef extent_size_quantize_floor -#define extent_size_quantize_floor JEMALLOC_N(n_extent_size_quantize_floor) +#ifndef JEMALLOC_JET +static #endif size_t extent_size_quantize_floor(size_t size) { @@ -130,9 +129,6 @@ extent_size_quantize_floor(size_t size) { assert(size > 0); assert((size & PAGE_MASK) == 0); - assert(size != 0); - assert(size == PAGE_CEILING(size)); - pind = psz2ind(size - large_pad + 1); if (pind == 0) { /* @@ -147,16 +143,9 @@ extent_size_quantize_floor(size_t size) { assert(ret <= size); return ret; } -#ifdef JEMALLOC_JET -#undef extent_size_quantize_floor -#define extent_size_quantize_floor JEMALLOC_N(extent_size_quantize_floor) -extent_size_quantize_t *extent_size_quantize_floor = - JEMALLOC_N(n_extent_size_quantize_floor); -#endif -#ifdef JEMALLOC_JET -#undef extent_size_quantize_ceil -#define extent_size_quantize_ceil JEMALLOC_N(n_extent_size_quantize_ceil) +#ifndef JEMALLOC_JET +static #endif size_t extent_size_quantize_ceil(size_t size) { @@ -180,12 +169,6 @@ extent_size_quantize_ceil(size_t size) { } return ret; } -#ifdef JEMALLOC_JET -#undef extent_size_quantize_ceil -#define extent_size_quantize_ceil JEMALLOC_N(extent_size_quantize_ceil) -extent_size_quantize_t *extent_size_quantize_ceil = - JEMALLOC_N(n_extent_size_quantize_ceil); -#endif /* Generate pairing heap functions. */ ph_gen(, extent_heap_, extent_heap_t, extent_t, ph_link, extent_snad_comp) @@ -258,6 +241,7 @@ extents_first_best_fit_locked(tsdn_t *tsdn, arena_t *arena, extents_t *extents, for (pszind_t i = pind; i < NPSIZES+1; i++) { extent_t *extent = extent_heap_first(&extents->heaps[i]); if (extent != NULL) { + assert(extent_size_get(extent) >= size); return extent; } } |