| 195 | } |
| 196 | |
| 197 | static void |
| 198 | base_extent_bump_alloc_post(base_t *base, extent_t *extent, size_t gap_size, |
| 199 | void *addr, size_t size) { |
| 200 | if (extent_bsize_get(extent) > 0) { |
| 201 | /* |
| 202 | * Compute the index for the largest size class that does not |
| 203 | * exceed extent's size. |
| 204 | */ |
| 205 | szind_t index_floor = |
| 206 | sz_size2index(extent_bsize_get(extent) + 1) - 1; |
| 207 | extent_heap_insert(&base->avail[index_floor], extent); |
| 208 | } |
| 209 | |
| 210 | if (config_stats) { |
| 211 | base->allocated += size; |
| 212 | /* |
| 213 | * Add one PAGE to base_resident for every page boundary that is |
| 214 | * crossed by the new allocation. Adjust n_thp similarly when |
| 215 | * metadata_thp is enabled. |
| 216 | */ |
| 217 | base->resident += PAGE_CEILING((uintptr_t)addr + size) - |
| 218 | PAGE_CEILING((uintptr_t)addr - gap_size); |
| 219 | assert(base->allocated <= base->resident); |
| 220 | assert(base->resident <= base->mapped); |
| 221 | if (metadata_thp_madvise() && (opt_metadata_thp == |
| 222 | metadata_thp_always || base->auto_thp_switched)) { |
| 223 | base->n_thp += (HUGEPAGE_CEILING((uintptr_t)addr + size) |
| 224 | - HUGEPAGE_CEILING((uintptr_t)addr - gap_size)) >> |
| 225 | LG_HUGEPAGE; |
| 226 | assert(base->mapped >= base->n_thp << LG_HUGEPAGE); |
| 227 | } |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | static void * |
| 232 | base_extent_bump_alloc(base_t *base, extent_t *extent, size_t size, |
no test coverage detected