kmalloc: add consistency test when KDEBUG is defined

This commit is contained in:
Michael Shaw 2023-05-10 21:41:25 -04:00
commit c712f0a7d6
3 changed files with 43 additions and 6 deletions

View file

@ -225,11 +225,7 @@ void slabtypes_init()
kmalloc_init();
}
void malloc_post()
bool kmalloc_verify()
{
bool verify = rbt_verify(&kmalloc_tree);
if(!verify)
printf(LOG_ERROR, "kmalloc tree is corrupted!\n");
else
printf(LOG_SUCCESS "kmalloc tree is OK!\n");
return rbt_verify(&kmalloc_tree);
}