Ehooks: Add some debug zero and addr checks.

These help make sure that the ehooks return properly zeroed memory when required
to.
This commit is contained in:
David Goldblatt
2019-12-05 17:09:44 -08:00
committed by David Goldblatt
parent 4b2e5ee8b9
commit a738a66b5c
2 changed files with 66 additions and 16 deletions

View File

@@ -821,13 +821,6 @@ extent_recycle(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks, eset_t *eset,
ehooks_zero(tsdn, ehooks, addr, size,
arena_ind_get(arena));
}
if (config_debug) {
size_t *p = (size_t *)(uintptr_t)addr;
/* Check the first page only. */
for (size_t i = 0; i < PAGE / sizeof(size_t); i++) {
assert(p[i] == 0);
}
}
}
return extent;
}