diff options
author | Chris Peterson <cpeterson@mozilla.com> | 2016-03-27 23:28:39 -0700 |
---|---|---|
committer | Jason Evans <je@fb.com> | 2016-03-31 11:23:29 -0700 |
commit | a82070ef5fc3aa81fda43086cdcc22bfa826b894 (patch) | |
tree | 18b435a9a510f17fba79d20ddcfe9f84998210e1 /test | |
parent | f86bc081d6190be14c64aeaae9d02863b440bfb3 (diff) | |
download | jemalloc-a82070ef5fc3aa81fda43086cdcc22bfa826b894.tar.gz |
Add JEMALLOC_ALLOC_JUNK and JEMALLOC_FREE_JUNK macros
Replace hardcoded 0xa5 and 0x5a junk values with JEMALLOC_ALLOC_JUNK and
JEMALLOC_FREE_JUNK macros, respectively.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/junk.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/unit/junk.c b/test/unit/junk.c index b23dd1e..f4e6226 100644 --- a/test/unit/junk.c +++ b/test/unit/junk.c @@ -29,7 +29,7 @@ arena_dalloc_junk_small_intercept(void *ptr, arena_bin_info_t *bin_info) arena_dalloc_junk_small_orig(ptr, bin_info); for (i = 0; i < bin_info->reg_size; i++) { - assert_c_eq(((char *)ptr)[i], 0x5a, + assert_c_eq(((char *)ptr)[i], JEMALLOC_FREE_JUNK, "Missing junk fill for byte %zu/%zu of deallocated region", i, bin_info->reg_size); } @@ -44,7 +44,7 @@ arena_dalloc_junk_large_intercept(void *ptr, size_t usize) arena_dalloc_junk_large_orig(ptr, usize); for (i = 0; i < usize; i++) { - assert_c_eq(((char *)ptr)[i], 0x5a, + assert_c_eq(((char *)ptr)[i], JEMALLOC_FREE_JUNK, "Missing junk fill for byte %zu/%zu of deallocated region", i, usize); } @@ -98,7 +98,7 @@ test_junk(size_t sz_min, size_t sz_max) for (i = sz_prev; i < sz; i++) { if (opt_junk_alloc) { - assert_c_eq(s[i], 0xa5, + assert_c_eq(s[i], JEMALLOC_ALLOC_JUNK, "Newly allocated byte %zu/%zu isn't " "junk-filled", i, sz); } |