mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-05 03:19:58 +03:00
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.
This commit is contained in:
parent
8dd5ea87ca
commit
ea9961acdb
7 changed files with 39 additions and 53 deletions
|
|
@ -83,7 +83,7 @@ enum {
|
|||
static uint8_t malloc_slow_flags;
|
||||
|
||||
JEMALLOC_ALIGNED(CACHELINE)
|
||||
const size_t pind2sz_tab[NPSIZES] = {
|
||||
const size_t pind2sz_tab[NPSIZES+1] = {
|
||||
#define PSZ_yes(lg_grp, ndelta, lg_delta) \
|
||||
(((ZU(1)<<lg_grp) + (ZU(ndelta)<<lg_delta))),
|
||||
#define PSZ_no(lg_grp, ndelta, lg_delta)
|
||||
|
|
@ -93,6 +93,7 @@ const size_t pind2sz_tab[NPSIZES] = {
|
|||
#undef PSZ_yes
|
||||
#undef PSZ_no
|
||||
#undef SC
|
||||
(LARGE_MAXCLASS + PAGE)
|
||||
};
|
||||
|
||||
JEMALLOC_ALIGNED(CACHELINE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue