MCPcopy Create free account
hub / github.com/F-Stack/f-stack / uma_dbg_alloc

Function uma_dbg_alloc

freebsd/vm/uma_core.c:5441–5460  ·  view source on GitHub ↗

* Set up the slab's freei data such that uma_dbg_free can function. * */

Source from the content-addressed store, hash-verified

5439 *
5440 */
5441static void
5442uma_dbg_alloc(uma_zone_t zone, uma_slab_t slab, void *item)
5443{
5444 uma_keg_t keg;
5445 int freei;
5446
5447 if (slab == NULL) {
5448 slab = uma_dbg_getslab(zone, item);
5449 if (slab == NULL)
5450 panic("uma: item %p did not belong to zone %s",
5451 item, zone->uz_name);
5452 }
5453 keg = zone->uz_keg;
5454 freei = slab_item_index(slab, keg, item);
5455
5456 if (BIT_TEST_SET_ATOMIC(keg->uk_ipers, freei,
5457 slab_dbg_bits(slab, keg)))
5458 panic("Duplicate alloc of %p from zone %p(%s) slab %p(%d)",
5459 item, zone, zone->uz_name, slab, freei);
5460}
5461
5462/*
5463 * Verifies freed addresses. Checks for alignment, valid slab membership

Callers 1

item_ctorFunction · 0.85

Calls 4

uma_dbg_getslabFunction · 0.85
slab_dbg_bitsFunction · 0.85
slab_item_indexFunction · 0.70
panicFunction · 0.50

Tested by

no test coverage detected