mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-06-30 03:06:03 +03:00
SC: Remove global data.
The global data is mostly only used at initialization, or for easy access to values we could compute statically. Instead of consuming that space (and risking TLB misses), we can just pass around a pointer to stack data during bootstrapping.
This commit is contained in:
parent
4bc48718b2
commit
3aba072cef
16 changed files with 73 additions and 73 deletions
6
src/sz.c
6
src/sz.c
|
|
@ -2,7 +2,7 @@
|
|||
#include "jemalloc/internal/sz.h"
|
||||
|
||||
JEMALLOC_ALIGNED(CACHELINE)
|
||||
size_t sz_pind2sz_tab[SC_NPSIZES_MAX+1];
|
||||
size_t sz_pind2sz_tab[SC_NPSIZES+1];
|
||||
|
||||
static void
|
||||
sz_boot_pind2sz_tab(const sc_data_t *sc_data) {
|
||||
|
|
@ -15,7 +15,9 @@ sz_boot_pind2sz_tab(const sc_data_t *sc_data) {
|
|||
pind++;
|
||||
}
|
||||
}
|
||||
sz_pind2sz_tab[pind] = sc_data->large_maxclass + PAGE;
|
||||
for (int i = pind; i <= (int)SC_NPSIZES; i++) {
|
||||
sz_pind2sz_tab[pind] = sc_data->large_maxclass + PAGE;
|
||||
}
|
||||
}
|
||||
|
||||
JEMALLOC_ALIGNED(CACHELINE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue