diff options
author | bmilekic <bmilekic@FreeBSD.org> | 2003-08-02 22:40:27 +0000 |
---|---|---|
committer | bmilekic <bmilekic@FreeBSD.org> | 2003-08-02 22:40:27 +0000 |
commit | 2a8e0c5c0ab64ec487005880e469d8875ec84225 (patch) | |
tree | 14e5825c3e2a6af3411ec32969fb56399be1e1b5 /sys | |
parent | 6bcc87d469eb05ccb82c89cf28c523ecf46be17c (diff) | |
download | FreeBSD-src-2a8e0c5c0ab64ec487005880e469d8875ec84225.zip FreeBSD-src-2a8e0c5c0ab64ec487005880e469d8875ec84225.tar.gz |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vm/uma_core.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 47daeee..1ec706a 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -1811,6 +1811,21 @@ zfree_start: 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; |