003 File Manager
Current Path:
/usr/src/contrib/jemalloc/src
usr
/
src
/
contrib
/
jemalloc
/
src
/
📁
..
📄
arena.c
(67.17 KB)
📄
background_thread.c
(27.15 KB)
📄
base.c
(15.17 KB)
📄
bin.c
(2.43 KB)
📄
bitmap.c
(3.12 KB)
📄
ckh.c
(14.37 KB)
📄
ctl.c
(98.71 KB)
📄
div.c
(1.53 KB)
📄
extent.c
(71.71 KB)
📄
extent_dss.c
(6.8 KB)
📄
extent_mmap.c
(933 B)
📄
hash.c
(132 B)
📄
hook.c
(5.61 KB)
📄
jemalloc.c
(102.52 KB)
📄
large.c
(11.54 KB)
📄
log.c
(2.43 KB)
📄
malloc_io.c
(14.71 KB)
📄
mutex.c
(6.04 KB)
📄
mutex_pool.c
(481 B)
📄
nstime.c
(3.42 KB)
📄
pages.c
(15.04 KB)
📄
prng.c
(132 B)
📄
prof.c
(76.28 KB)
📄
rtree.c
(8.58 KB)
📄
safety_check.c
(565 B)
📄
sc.c
(8.24 KB)
📄
stats.c
(47.77 KB)
📄
sz.c
(1.74 KB)
📄
tcache.c
(21.86 KB)
📄
test_hooks.c
(407 B)
📄
ticker.c
(134 B)
📄
tsd.c
(14.24 KB)
📄
witness.c
(2.4 KB)
Editing: sz.c
#include "jemalloc/internal/jemalloc_preamble.h" #include "jemalloc/internal/sz.h" JEMALLOC_ALIGNED(CACHELINE) size_t sz_pind2sz_tab[SC_NPSIZES+1]; static void sz_boot_pind2sz_tab(const sc_data_t *sc_data) { int pind = 0; for (unsigned i = 0; i < SC_NSIZES; i++) { const sc_t *sc = &sc_data->sc[i]; if (sc->psz) { sz_pind2sz_tab[pind] = (ZU(1) << sc->lg_base) + (ZU(sc->ndelta) << sc->lg_delta); pind++; } } for (int i = pind; i <= (int)SC_NPSIZES; i++) { sz_pind2sz_tab[pind] = sc_data->large_maxclass + PAGE; } } JEMALLOC_ALIGNED(CACHELINE) size_t sz_index2size_tab[SC_NSIZES]; static void sz_boot_index2size_tab(const sc_data_t *sc_data) { for (unsigned i = 0; i < SC_NSIZES; i++) { const sc_t *sc = &sc_data->sc[i]; sz_index2size_tab[i] = (ZU(1) << sc->lg_base) + (ZU(sc->ndelta) << (sc->lg_delta)); } } /* * To keep this table small, we divide sizes by the tiny min size, which gives * the smallest interval for which the result can change. */ JEMALLOC_ALIGNED(CACHELINE) uint8_t sz_size2index_tab[(SC_LOOKUP_MAXCLASS >> SC_LG_TINY_MIN) + 1]; static void sz_boot_size2index_tab(const sc_data_t *sc_data) { size_t dst_max = (SC_LOOKUP_MAXCLASS >> SC_LG_TINY_MIN) + 1; size_t dst_ind = 0; for (unsigned sc_ind = 0; sc_ind < SC_NSIZES && dst_ind < dst_max; sc_ind++) { const sc_t *sc = &sc_data->sc[sc_ind]; size_t sz = (ZU(1) << sc->lg_base) + (ZU(sc->ndelta) << sc->lg_delta); size_t max_ind = ((sz + (ZU(1) << SC_LG_TINY_MIN) - 1) >> SC_LG_TINY_MIN); for (; dst_ind <= max_ind && dst_ind < dst_max; dst_ind++) { sz_size2index_tab[dst_ind] = sc_ind; } } } void sz_boot(const sc_data_t *sc_data) { sz_boot_pind2sz_tab(sc_data); sz_boot_index2size_tab(sc_data); sz_boot_size2index_tab(sc_data); }
Upload File
Create Folder