summaryrefslogtreecommitdiffstats
path: root/src/arena.c
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2016-11-04 04:18:50 (GMT)
committerJason Evans <jasone@canonware.com>2016-11-04 05:33:34 (GMT)
commitea9961acdbc9f7e2c95a3b55ce0ac1024af5d167 (patch)
tree57494db410e0250c3d28958e9363e15976eb5c9a /src/arena.c
parent8dd5ea87cac39d9a90dbe40d13267ec02df0214c (diff)
downloadjemalloc-ea9961acdbc9f7e2c95a3b55ce0ac1024af5d167.zip
jemalloc-ea9961acdbc9f7e2c95a3b55ce0ac1024af5d167.tar.gz
jemalloc-ea9961acdbc9f7e2c95a3b55ce0ac1024af5d167.tar.bz2
Fix psz/pind edge cases.
Add an "over-size" extent heap in which to store extents which exceed the maximum size class (plus cache-oblivious padding, if enabled). Remove psz2ind_clamp() and use psz2ind() instead so that trying to allocate the maximum size class can in principle succeed. In practice, this allows assertions to hold so that OOM errors can be successfully generated.
Diffstat (limited to 'src/arena.c')
-rw-r--r--src/arena.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/arena.c b/src/arena.c
index fd3c553..dd8e4d9 100644
--- a/src/arena.c
+++ b/src/arena.c
@@ -1696,7 +1696,7 @@ arena_new(tsdn_t *tsdn, unsigned ind)
WITNESS_RANK_ARENA_LARGE))
return (NULL);
- for (i = 0; i < NPSIZES; i++) {
+ for (i = 0; i < NPSIZES+1; i++) {
extent_heap_new(&arena->extents_cached[i]);
extent_heap_new(&arena->extents_retained[i]);
}