s/CHUNK_HOOKS_INITIALIZER/EXTENT_HOOKS_INITIALIZER/g

This commit is contained in:
Jason Evans 2016-06-01 11:56:45 -07:00
parent c9a76481d8
commit 4a55daa363
5 changed files with 16 additions and 16 deletions

View File

@ -11,16 +11,6 @@
#define CHUNK_CEILING(s) \ #define CHUNK_CEILING(s) \
(((s) + chunksize_mask) & ~chunksize_mask) (((s) + chunksize_mask) & ~chunksize_mask)
#define CHUNK_HOOKS_INITIALIZER { \
NULL, \
NULL, \
NULL, \
NULL, \
NULL, \
NULL, \
NULL \
}
#endif /* JEMALLOC_H_TYPES */ #endif /* JEMALLOC_H_TYPES */
/******************************************************************************/ /******************************************************************************/
#ifdef JEMALLOC_H_STRUCTS #ifdef JEMALLOC_H_STRUCTS

View File

@ -3,6 +3,16 @@
typedef struct extent_s extent_t; typedef struct extent_s extent_t;
#define EXTENT_HOOKS_INITIALIZER { \
NULL, \
NULL, \
NULL, \
NULL, \
NULL, \
NULL, \
NULL \
}
#endif /* JEMALLOC_H_TYPES */ #endif /* JEMALLOC_H_TYPES */
/******************************************************************************/ /******************************************************************************/
#ifdef JEMALLOC_H_STRUCTS #ifdef JEMALLOC_H_STRUCTS

View File

@ -347,7 +347,7 @@ arena_chunk_alloc_large(tsdn_t *tsdn, arena_t *arena, size_t usize,
size_t alignment, bool *zero) size_t alignment, bool *zero)
{ {
extent_t *extent; extent_t *extent;
extent_hooks_t extent_hooks = CHUNK_HOOKS_INITIALIZER; extent_hooks_t extent_hooks = EXTENT_HOOKS_INITIALIZER;
malloc_mutex_lock(tsdn, &arena->lock); malloc_mutex_lock(tsdn, &arena->lock);
@ -373,7 +373,7 @@ void
arena_chunk_dalloc_large(tsdn_t *tsdn, arena_t *arena, extent_t *extent, arena_chunk_dalloc_large(tsdn_t *tsdn, arena_t *arena, extent_t *extent,
bool locked) bool locked)
{ {
extent_hooks_t extent_hooks = CHUNK_HOOKS_INITIALIZER; extent_hooks_t extent_hooks = EXTENT_HOOKS_INITIALIZER;
if (!locked) if (!locked)
malloc_mutex_lock(tsdn, &arena->lock); malloc_mutex_lock(tsdn, &arena->lock);
@ -866,7 +866,7 @@ arena_purge(tsdn_t *tsdn, arena_t *arena, bool all)
static void static void
arena_slab_dalloc(tsdn_t *tsdn, arena_t *arena, extent_t *slab) arena_slab_dalloc(tsdn_t *tsdn, arena_t *arena, extent_t *slab)
{ {
extent_hooks_t extent_hooks = CHUNK_HOOKS_INITIALIZER; extent_hooks_t extent_hooks = EXTENT_HOOKS_INITIALIZER;
arena_nactive_sub(arena, extent_size_get(slab) >> LG_PAGE); arena_nactive_sub(arena, extent_size_get(slab) >> LG_PAGE);
arena_chunk_cache_dalloc_locked(tsdn, arena, &extent_hooks, slab); arena_chunk_cache_dalloc_locked(tsdn, arena, &extent_hooks, slab);
@ -1009,7 +1009,7 @@ arena_slab_alloc(tsdn_t *tsdn, arena_t *arena, szind_t binind,
{ {
extent_t *slab; extent_t *slab;
arena_slab_data_t *slab_data; arena_slab_data_t *slab_data;
extent_hooks_t extent_hooks = CHUNK_HOOKS_INITIALIZER; extent_hooks_t extent_hooks = EXTENT_HOOKS_INITIALIZER;
bool zero; bool zero;
zero = false; zero = false;

View File

@ -131,7 +131,7 @@ extent_hooks_assure_initialized_impl(tsdn_t *tsdn, arena_t *arena,
extent_hooks_t *extent_hooks, bool locked) extent_hooks_t *extent_hooks, bool locked)
{ {
static const extent_hooks_t uninitialized_hooks = static const extent_hooks_t uninitialized_hooks =
CHUNK_HOOKS_INITIALIZER; EXTENT_HOOKS_INITIALIZER;
if (memcmp(extent_hooks, &uninitialized_hooks, sizeof(extent_hooks_t)) if (memcmp(extent_hooks, &uninitialized_hooks, sizeof(extent_hooks_t))
== 0) { == 0) {

View File

@ -137,7 +137,7 @@ chunk_alloc_dss(tsdn_t *tsdn, arena_t *arena, void *new_addr, size_t size,
malloc_mutex_unlock(tsdn, &dss_mtx); malloc_mutex_unlock(tsdn, &dss_mtx);
if (pad_size != 0) { if (pad_size != 0) {
extent_hooks_t extent_hooks = extent_hooks_t extent_hooks =
CHUNK_HOOKS_INITIALIZER; EXTENT_HOOKS_INITIALIZER;
chunk_dalloc_wrapper(tsdn, arena, chunk_dalloc_wrapper(tsdn, arena,
&extent_hooks, pad); &extent_hooks, pad);
} else } else