summaryrefslogtreecommitdiffstats
path: root/src/arena.c
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2012-04-20 01:28:03 (GMT)
committerJason Evans <je@fb.com>2012-04-20 01:28:03 (GMT)
commitf7088e6c992d079bc3162e0c48ed4dc5def6d263 (patch)
tree5235e14406e3ffaf47e04eccc208b17932e5346d /src/arena.c
parent13067ec8350f213c3accc2e5fb70ca5a503e0e17 (diff)
downloadjemalloc-f7088e6c992d079bc3162e0c48ed4dc5def6d263.zip
jemalloc-f7088e6c992d079bc3162e0c48ed4dc5def6d263.tar.gz
jemalloc-f7088e6c992d079bc3162e0c48ed4dc5def6d263.tar.bz2
Make arena_salloc() an inline function.
Diffstat (limited to 'src/arena.c')
-rw-r--r--src/arena.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/arena.c b/src/arena.c
index ed47824..6f28abe 100644
--- a/src/arena.c
+++ b/src/arena.c
@@ -1465,46 +1465,6 @@ arena_palloc(arena_t *arena, size_t size, size_t alignment, bool zero)
return (ret);
}
-/* Return the size of the allocation pointed to by ptr. */
-size_t
-arena_salloc(const void *ptr, bool demote)
-{
- size_t ret;
- arena_chunk_t *chunk;
- size_t pageind, mapbits;
-
- assert(ptr != NULL);
- assert(CHUNK_ADDR2BASE(ptr) != ptr);
-
- chunk = (arena_chunk_t *)CHUNK_ADDR2BASE(ptr);
- pageind = ((uintptr_t)ptr - (uintptr_t)chunk) >> LG_PAGE;
- mapbits = chunk->map[pageind-map_bias].bits;
- assert((mapbits & CHUNK_MAP_ALLOCATED) != 0);
- if ((mapbits & CHUNK_MAP_LARGE) == 0) {
- arena_run_t *run = (arena_run_t *)((uintptr_t)chunk +
- (uintptr_t)((pageind - (mapbits >> LG_PAGE)) << LG_PAGE));
- size_t binind = arena_bin_index(chunk->arena, run->bin);
- arena_bin_info_t *bin_info = &arena_bin_info[binind];
- assert(((uintptr_t)ptr - ((uintptr_t)run +
- (uintptr_t)bin_info->reg0_offset)) % bin_info->reg_interval
- == 0);
- ret = bin_info->reg_size;
- } else {
- assert(((uintptr_t)ptr & PAGE_MASK) == 0);
- ret = mapbits & ~PAGE_MASK;
- if (config_prof && demote && prof_promote && ret == PAGE &&
- (mapbits & CHUNK_MAP_CLASS_MASK) != 0) {
- size_t binind = ((mapbits & CHUNK_MAP_CLASS_MASK) >>
- CHUNK_MAP_CLASS_SHIFT) - 1;
- assert(binind < NBINS);
- ret = arena_bin_info[binind].reg_size;
- }
- assert(ret != 0);
- }
-
- return (ret);
-}
-
void
arena_prof_promoted(const void *ptr, size_t size)
{