diff options
author | Jason Evans <je@fb.com> | 2012-02-13 10:24:43 -0800 |
---|---|---|
committer | Jason Evans <je@fb.com> | 2012-02-13 10:24:43 -0800 |
commit | fd56043c53f1cd1335ae6d1c0ee86cc0fbb9f12e (patch) | |
tree | 384192cb6b0415aafbfc43497a58d2b020c9191a /include/jemalloc | |
parent | 7372b15a31c63ac5cb9ed8aeabc2a0a3c005e8bf (diff) | |
download | platform_external_jemalloc_new-fd56043c53f1cd1335ae6d1c0ee86cc0fbb9f12e.tar.gz platform_external_jemalloc_new-fd56043c53f1cd1335ae6d1c0ee86cc0fbb9f12e.tar.bz2 platform_external_jemalloc_new-fd56043c53f1cd1335ae6d1c0ee86cc0fbb9f12e.zip |
Remove magic.
Remove structure magic, because 1) it is no longer conditional, and 2)
it stopped being very effective at detecting memory corruption several
years ago.
Diffstat (limited to 'include/jemalloc')
-rw-r--r-- | include/jemalloc/internal/arena.h | 11 | ||||
-rw-r--r-- | include/jemalloc/internal/ckh.h | 3 | ||||
-rw-r--r-- | include/jemalloc/internal/jemalloc_internal.h.in | 2 | ||||
-rw-r--r-- | include/jemalloc/internal/prof.h | 4 | ||||
-rw-r--r-- | include/jemalloc/internal/tcache.h | 1 |
5 files changed, 0 insertions, 21 deletions
diff --git a/include/jemalloc/internal/arena.h b/include/jemalloc/internal/arena.h index b6a5c23d..78ea2696 100644 --- a/include/jemalloc/internal/arena.h +++ b/include/jemalloc/internal/arena.h @@ -211,9 +211,6 @@ struct arena_chunk_s { typedef rb_tree(arena_chunk_t) arena_chunk_tree_t; struct arena_run_s { - uint32_t magic; -# define ARENA_RUN_MAGIC 0x384adf93 - /* Bin this run is associated with. */ arena_bin_t *bin; @@ -290,9 +287,6 @@ struct arena_bin_s { }; struct arena_s { - uint32_t magic; -# define ARENA_MAGIC 0x947d3d24 - /* This arena's index within the arenas array. */ unsigned ind; @@ -499,7 +493,6 @@ arena_run_regind(arena_run_t *run, arena_bin_info_t *bin_info, const void *ptr) unsigned shift, diff, regind; size_t size; - assert(run->magic == ARENA_RUN_MAGIC); /* * Freeing a pointer lower than region zero can cause assertion * failure. @@ -590,7 +583,6 @@ arena_prof_ctx_get(const void *ptr) arena_bin_info_t *bin_info = &arena_bin_info[binind]; unsigned regind; - assert(run->magic == ARENA_RUN_MAGIC); regind = arena_run_regind(run, bin_info, ptr); ret = *(prof_ctx_t **)((uintptr_t)run + bin_info->ctx0_offset + (regind * @@ -626,7 +618,6 @@ arena_prof_ctx_set(const void *ptr, prof_ctx_t *ctx) arena_bin_info_t *bin_info; unsigned regind; - assert(run->magic == ARENA_RUN_MAGIC); binind = arena_bin_index(chunk->arena, bin); bin_info = &arena_bin_info[binind]; regind = arena_run_regind(run, bin_info, ptr); @@ -646,7 +637,6 @@ arena_dalloc(arena_t *arena, arena_chunk_t *chunk, void *ptr) arena_chunk_map_t *mapelm; assert(arena != NULL); - assert(arena->magic == ARENA_MAGIC); assert(chunk->arena == arena); assert(ptr != NULL); assert(CHUNK_ADDR2BASE(ptr) != ptr); @@ -667,7 +657,6 @@ arena_dalloc(arena_t *arena, arena_chunk_t *chunk, void *ptr) run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - (mapelm->bits >> PAGE_SHIFT)) << PAGE_SHIFT)); - assert(run->magic == ARENA_RUN_MAGIC); bin = run->bin; if (config_debug) { size_t binind = arena_bin_index(arena, bin); diff --git a/include/jemalloc/internal/ckh.h b/include/jemalloc/internal/ckh.h index 28f171c8..65f30f56 100644 --- a/include/jemalloc/internal/ckh.h +++ b/include/jemalloc/internal/ckh.h @@ -30,9 +30,6 @@ struct ckhc_s { }; struct ckh_s { -#define CKH_MAGIC 0x3af2489d - uint32_t magic; - #ifdef CKH_COUNT /* Counters used to get an idea of performance. */ uint64_t ngrows; diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in index 8842e4bf..3193d35e 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -774,8 +774,6 @@ isalloc(const void *ptr) chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); if (chunk != ptr) { /* Region. */ - assert(chunk->arena->magic == ARENA_MAGIC); - if (config_prof) ret = arena_salloc_demote(ptr); else diff --git a/include/jemalloc/internal/prof.h b/include/jemalloc/internal/prof.h index d4700808..98f96546 100644 --- a/include/jemalloc/internal/prof.h +++ b/include/jemalloc/internal/prof.h @@ -336,8 +336,6 @@ prof_ctx_get(const void *ptr) chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); if (chunk != ptr) { /* Region. */ - assert(chunk->arena->magic == ARENA_MAGIC); - ret = arena_prof_ctx_get(ptr); } else ret = huge_prof_ctx_get(ptr); @@ -356,8 +354,6 @@ prof_ctx_set(const void *ptr, prof_ctx_t *ctx) chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr); if (chunk != ptr) { /* Region. */ - assert(chunk->arena->magic == ARENA_MAGIC); - arena_prof_ctx_set(ptr, ctx); } else huge_prof_ctx_set(ptr, ctx); diff --git a/include/jemalloc/internal/tcache.h b/include/jemalloc/internal/tcache.h index 0855d32e..83e03d9d 100644 --- a/include/jemalloc/internal/tcache.h +++ b/include/jemalloc/internal/tcache.h @@ -333,7 +333,6 @@ tcache_dalloc_small(tcache_t *tcache, void *ptr) mapelm = &chunk->map[pageind-map_bias]; run = (arena_run_t *)((uintptr_t)chunk + (uintptr_t)((pageind - (mapelm->bits >> PAGE_SHIFT)) << PAGE_SHIFT)); - assert(run->magic == ARENA_RUN_MAGIC); bin = run->bin; binind = ((uintptr_t)bin - (uintptr_t)&arena->bins) / sizeof(arena_bin_t); |