MCPcopy Create free account
hub / github.com/beefytech/Beef / pac_dalloc_impl

Function pac_dalloc_impl

BeefRT/JEMalloc/src/pac.c:250–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250static void
251pac_dalloc_impl(tsdn_t *tsdn, pai_t *self, edata_t *edata,
252 bool *deferred_work_generated) {
253 pac_t *pac = (pac_t *)self;
254 ehooks_t *ehooks = pac_ehooks_get(pac);
255
256 if (edata_guarded_get(edata)) {
257 /*
258 * Because cached guarded extents do exact fit only, large
259 * guarded extents are restored on dalloc eagerly (otherwise
260 * they will not be reused efficiently). Slab sizes have a
261 * limited number of size classes, and tend to cycle faster.
262 *
263 * In the case where coalesce is restrained (VirtualFree on
264 * Windows), guarded extents are also not cached -- otherwise
265 * during arena destroy / reset, the retained extents would not
266 * be whole regions (i.e. they are split between regular and
267 * guarded).
268 */
269 if (!edata_slab_get(edata) || !maps_coalesce) {
270 assert(edata_size_get(edata) >= SC_LARGE_MINCLASS ||
271 !maps_coalesce);
272 san_unguard_pages_two_sided(tsdn, ehooks, edata,
273 pac->emap);
274 }
275 }
276
277 ecache_dalloc(tsdn, pac, ehooks, &pac->ecache_dirty, edata);
278 /* Purging of deallocated pages is deferred */
279 *deferred_work_generated = true;
280}
281
282static inline uint64_t
283pac_ns_until_purge(tsdn_t *tsdn, decay_t *decay, size_t npages) {

Callers

nothing calls this directly

Calls 6

pac_ehooks_getFunction · 0.85
edata_guarded_getFunction · 0.85
edata_slab_getFunction · 0.85
edata_size_getFunction · 0.85
ecache_dallocFunction · 0.85

Tested by

no test coverage detected