summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/slab.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/slab.c b/lib/slab.c
index 1d844bab..9a4c3ee2 100644
--- a/lib/slab.c
+++ b/lib/slab.c
@@ -272,6 +272,9 @@ no_partial:
goto okay;
}
h = alloc_page();
+#ifdef POISON
+ memset(h, 0xba, get_page_size());
+#endif
ASSERT_DIE(SL_GET_HEAD(h) == h);
memset(h, 0, s->head_size);
add_head(&s->partial_heads, &h->n);
@@ -327,7 +330,12 @@ sl_free(slab *s, void *oo)
{
rem_node(&h->n);
if (s->num_empty_heads >= MAX_EMPTY_HEADS)
+ {
+#ifdef POISON
+ memset(h, 0xde, get_page_size());
+#endif
free_page(h);
+ }
else
{
add_head(&s->empty_heads, &h->n);