| 29 | } |
| 30 | |
| 31 | static void * |
| 32 | base_map(tsdn_t *tsdn, extent_hooks_t *extent_hooks, unsigned ind, size_t size) { |
| 33 | void *addr; |
| 34 | bool zero = true; |
| 35 | bool commit = true; |
| 36 | |
| 37 | /* Use huge page sizes and alignment regardless of opt_metadata_thp. */ |
| 38 | assert(size == HUGEPAGE_CEILING(size)); |
| 39 | size_t alignment = HUGEPAGE; |
| 40 | if (extent_hooks == &extent_hooks_default) { |
| 41 | addr = extent_alloc_mmap(NULL, size, alignment, &zero, &commit); |
| 42 | } else { |
| 43 | /* No arena context as we are creating new arenas. */ |
| 44 | tsd_t *tsd = tsdn_null(tsdn) ? tsd_fetch() : tsdn_tsd(tsdn); |
| 45 | pre_reentrancy(tsd, NULL); |
| 46 | addr = extent_hooks->alloc(extent_hooks, NULL, size, alignment, |
| 47 | &zero, &commit, ind); |
| 48 | post_reentrancy(tsd); |
| 49 | } |
| 50 | |
| 51 | return addr; |
| 52 | } |
| 53 | |
| 54 | static void |
| 55 | base_unmap(tsdn_t *tsdn, extent_hooks_t *extent_hooks, unsigned ind, void *addr, |
no test coverage detected