aboutsummaryrefslogtreecommitdiff
path: root/include/jemalloc/internal/chunk.h
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-04-16 11:10:55 +0000
committerNicolas Geoffray <ngeoffray@google.com>2015-04-16 11:10:55 +0000
commit75929a97332565c3b987986f35652b6d5d275d3c (patch)
tree6c24378eef62b4381033b9615d247f5934fc0342 /include/jemalloc/internal/chunk.h
parent5b5d97b42e84c2ac417271c3fab6fc282496a335 (diff)
downloadjemalloc-75929a97332565c3b987986f35652b6d5d275d3c.tar.gz
Revert "Merge remote-tracking branch 'aosp/upstream-dev' into merge"
Revert due to random ART crashes seen. This reverts commit 5b5d97b42e84c2ac417271c3fab6fc282496a335. Change-Id: I62a784301fded7ee853b182d172be46bb32bded7
Diffstat (limited to 'include/jemalloc/internal/chunk.h')
-rw-r--r--include/jemalloc/internal/chunk.h52
1 files changed, 15 insertions, 37 deletions
diff --git a/include/jemalloc/internal/chunk.h b/include/jemalloc/internal/chunk.h
index 8093814..f3bfbe0 100644
--- a/include/jemalloc/internal/chunk.h
+++ b/include/jemalloc/internal/chunk.h
@@ -5,7 +5,7 @@
* Size and alignment of memory chunks that are allocated by the OS's virtual
* memory system.
*/
-#define LG_CHUNK_DEFAULT 18
+#define LG_CHUNK_DEFAULT 22
/* Return the chunk address for allocation address a. */
#define CHUNK_ADDR2BASE(a) \
@@ -30,36 +30,27 @@
extern size_t opt_lg_chunk;
extern const char *opt_dss;
-extern rtree_t chunks_rtree;
+/* Protects stats_chunks; currently not used for any other purpose. */
+extern malloc_mutex_t chunks_mtx;
+/* Chunk statistics. */
+extern chunk_stats_t stats_chunks;
+
+extern rtree_t *chunks_rtree;
extern size_t chunksize;
extern size_t chunksize_mask; /* (chunksize - 1). */
extern size_t chunk_npages;
+extern size_t map_bias; /* Number of arena chunk header pages. */
+extern size_t arena_maxclass; /* Max size class for arenas. */
-bool chunk_register(const void *chunk, const extent_node_t *node);
-void chunk_deregister(const void *chunk, const extent_node_t *node);
void *chunk_alloc_base(size_t size);
-void *chunk_alloc_cache(arena_t *arena, void *new_addr, size_t size,
- size_t alignment, bool *zero, bool dalloc_node);
-void *chunk_alloc_default(void *new_addr, size_t size, size_t alignment,
- bool *zero, unsigned arena_ind);
-void *chunk_alloc_wrapper(arena_t *arena, chunk_alloc_t *chunk_alloc,
- void *new_addr, size_t size, size_t alignment, bool *zero);
-void chunk_record(arena_t *arena, extent_tree_t *chunks_szad,
- extent_tree_t *chunks_ad, bool cache, void *chunk, size_t size,
- bool zeroed);
-void chunk_dalloc_cache(arena_t *arena, void *chunk, size_t size);
-void chunk_dalloc_arena(arena_t *arena, void *chunk, size_t size,
- bool zeroed);
-bool chunk_dalloc_default(void *chunk, size_t size, unsigned arena_ind);
-void chunk_dalloc_wrapper(arena_t *arena, chunk_dalloc_t *chunk_dalloc,
- void *chunk, size_t size);
-bool chunk_purge_arena(arena_t *arena, void *chunk, size_t offset,
- size_t length);
-bool chunk_purge_default(void *chunk, size_t offset, size_t length,
+void *chunk_alloc_arena(chunk_alloc_t *chunk_alloc,
+ chunk_dalloc_t *chunk_dalloc, unsigned arena_ind, size_t size,
+ size_t alignment, bool *zero);
+void *chunk_alloc_default(size_t size, size_t alignment, bool *zero,
unsigned arena_ind);
-bool chunk_purge_wrapper(arena_t *arena, chunk_purge_t *chunk_purge,
- void *chunk, size_t offset, size_t length);
+void chunk_unmap(void *chunk, size_t size);
+bool chunk_dalloc_default(void *chunk, size_t size, unsigned arena_ind);
bool chunk_boot(void);
void chunk_prefork(void);
void chunk_postfork_parent(void);
@@ -69,19 +60,6 @@ void chunk_postfork_child(void);
/******************************************************************************/
#ifdef JEMALLOC_H_INLINES
-#ifndef JEMALLOC_ENABLE_INLINE
-extent_node_t *chunk_lookup(const void *chunk);
-#endif
-
-#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_CHUNK_C_))
-JEMALLOC_INLINE extent_node_t *
-chunk_lookup(const void *chunk)
-{
-
- return (rtree_get(&chunks_rtree, (uintptr_t)chunk));
-}
-#endif
-
#endif /* JEMALLOC_H_INLINES */
/******************************************************************************/