diff options
author | Maria Matejka <mq@ucw.cz> | 2022-03-02 10:01:44 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-03-02 10:01:44 +0100 |
commit | d071aca7aaf7a4add9e0d1d93029fb9a0fad560a (patch) | |
tree | 89999b8a4ab23b2243f8cbfca7bb700e85fae36b /lib/slab.c | |
parent | fcb4dd0c831339c4374ace17d8f2ae6ebfeed279 (diff) | |
parent | 2c13759136951ef0e70a3e3c2b2d3c9a387f7ed9 (diff) |
Merge commit '2c13759136951ef0e70a3e3c2b2d3c9a387f7ed9' into haugesund
Diffstat (limited to 'lib/slab.c')
-rw-r--r-- | lib/slab.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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); |