When INVARIANTS is on and we're in uma_zalloc_free(), we need to make
sure that uma_dbg_free() is called if we're about to call uma_zfree_internal() but we're asking it to skip the dtor and uma_dbg_free() call itself. So, if we're about to call uma_zfree_internal() from uma_zfree_arg() and skip == 1, call uma_dbg_free() ourselves.
This commit is contained in:
parent
3664d35cd5
commit
48bf87258f
@ -1811,6 +1811,21 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata)
|
||||
|
||||
zfree_internal:
|
||||
|
||||
#ifdef INVARIANTS
|
||||
/*
|
||||
* If we need to skip the dtor and the uma_dbg_free in uma_zfree_internal
|
||||
* because we've already called the dtor above, but we ended up here, then
|
||||
* we need to make sure that we take care of the uma_dbg_free immediately.
|
||||
*/
|
||||
if (skip) {
|
||||
ZONE_LOCK(zone);
|
||||
if (zone->uz_flags & UMA_ZFLAG_MALLOC)
|
||||
uma_dbg_free(zone, udata, item);
|
||||
else
|
||||
uma_dbg_free(zone, NULL, item);
|
||||
ZONE_UNLOCK(zone);
|
||||
}
|
||||
#endif
|
||||
uma_zfree_internal(zone, item, udata, skip);
|
||||
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user