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

Function pac_shrink_impl

BeefRT/JEMalloc/src/pac.c:228–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228static bool
229pac_shrink_impl(tsdn_t *tsdn, pai_t *self, edata_t *edata, size_t old_size,
230 size_t new_size, bool *deferred_work_generated) {
231 pac_t *pac = (pac_t *)self;
232 ehooks_t *ehooks = pac_ehooks_get(pac);
233
234 size_t shrink_amount = old_size - new_size;
235
236 if (ehooks_split_will_fail(ehooks)) {
237 return true;
238 }
239
240 edata_t *trail = extent_split_wrapper(tsdn, pac, ehooks, edata,
241 new_size, shrink_amount, /* holding_core_locks */ false);
242 if (trail == NULL) {
243 return true;
244 }
245 ecache_dalloc(tsdn, pac, ehooks, &pac->ecache_dirty, trail);
246 *deferred_work_generated = true;
247 return false;
248}
249
250static void
251pac_dalloc_impl(tsdn_t *tsdn, pai_t *self, edata_t *edata,

Callers

nothing calls this directly

Calls 4

pac_ehooks_getFunction · 0.85
ehooks_split_will_failFunction · 0.85
extent_split_wrapperFunction · 0.85
ecache_dallocFunction · 0.85

Tested by

no test coverage detected