diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/jemalloc/internal/tcache.h | 7 | ||||
-rw-r--r-- | include/jemalloc/internal/util.h | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/include/jemalloc/internal/tcache.h b/include/jemalloc/internal/tcache.h index 8357820..1edd39f 100644 --- a/include/jemalloc/internal/tcache.h +++ b/include/jemalloc/internal/tcache.h @@ -381,9 +381,10 @@ tcache_alloc_large(tsd_t *tsd, arena_t *arena, tcache_t *tcache, size_t size, } if (likely(!zero)) { if (slow_path && config_fill) { - if (unlikely(opt_junk_alloc)) - memset(ret, 0xa5, usize); - else if (unlikely(opt_zero)) + if (unlikely(opt_junk_alloc)) { + memset(ret, JEMALLOC_ALLOC_JUNK, + usize); + } else if (unlikely(opt_zero)) memset(ret, 0, usize); } } else diff --git a/include/jemalloc/internal/util.h b/include/jemalloc/internal/util.h index 228584a..949a0e0 100644 --- a/include/jemalloc/internal/util.h +++ b/include/jemalloc/internal/util.h @@ -40,6 +40,10 @@ */ #define MALLOC_PRINTF_BUFSIZE 4096 +/* Junk fill patterns. */ +#define JEMALLOC_ALLOC_JUNK 0xa5 +#define JEMALLOC_FREE_JUNK 0x5a + /* * Wrap a cpp argument that contains commas such that it isn't broken up into * multiple arguments. |