1 1.1 christos #ifndef JEMALLOC_INTERNAL_HPA_CENTRAL_H 2 1.1 christos #define JEMALLOC_INTERNAL_HPA_CENTRAL_H 3 1.1 christos 4 1.1 christos #include "jemalloc/internal/jemalloc_preamble.h" 5 1.1 christos #include "jemalloc/internal/base.h" 6 1.1 christos #include "jemalloc/internal/hpa_hooks.h" 7 1.1 christos #include "jemalloc/internal/hpdata.h" 8 1.1 christos #include "jemalloc/internal/mutex.h" 9 1.1 christos #include "jemalloc/internal/tsd_types.h" 10 1.1 christos 11 1.1 christos typedef struct hpa_central_s hpa_central_t; 12 1.1 christos struct hpa_central_s { 13 1.1 christos /* 14 1.1 christos * Guards expansion of eden. We separate this from the regular mutex so 15 1.1 christos * that cheaper operations can still continue while we're doing the OS 16 1.1 christos * call. 17 1.1 christos */ 18 1.1 christos malloc_mutex_t grow_mtx; 19 1.1 christos /* 20 1.1 christos * Either NULL (if empty), or some integer multiple of a 21 1.1 christos * hugepage-aligned number of hugepages. We carve them off one at a 22 1.1 christos * time to satisfy new pageslab requests. 23 1.1 christos * 24 1.1 christos * Guarded by grow_mtx. 25 1.1 christos */ 26 1.1 christos void *eden; 27 1.1 christos size_t eden_len; 28 1.1 christos /* Source for metadata. */ 29 1.1 christos base_t *base; 30 1.1 christos 31 1.1 christos /* The HPA hooks. */ 32 1.1 christos hpa_hooks_t hooks; 33 1.1 christos }; 34 1.1 christos 35 1.1 christos bool hpa_central_init( 36 1.1 christos hpa_central_t *central, base_t *base, const hpa_hooks_t *hooks); 37 1.1 christos 38 1.1 christos hpdata_t *hpa_central_extract(tsdn_t *tsdn, hpa_central_t *central, size_t size, 39 1.1 christos uint64_t age, bool hugify_eager, bool *oom); 40 1.1 christos 41 1.1 christos #endif /* JEMALLOC_INTERNAL_HPA_CENTRAL_H */ 42