vm_object: Assert that overcommit charge is released in the object dtor

Reviewed by:	alc, kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35780
This commit is contained in:
Mark Johnston 2022-07-12 08:53:05 -04:00
parent 6b38974085
commit e1979b45b6

View File

@ -204,6 +204,9 @@ vm_object_zdtor(void *mem, int size, void *arg)
KASSERT(object->type == OBJT_DEAD,
("object %p has non-dead type %d",
object, object->type));
KASSERT(object->charge == 0 && object->cred == NULL,
("object %p has non-zero charge %ju (%p)",
object, (uintmax_t)object->charge, object->cred));
}
#endif