summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2016-04-22 21:37:17 (GMT)
committerJason Evans <jasone@canonware.com>2016-04-22 22:20:06 (GMT)
commit19ff2cefba48d1ddab8fb52e3d78f309ca2553cf (patch)
tree25c4cba5d31e58642058e15bbfd8cc834594d150 /include
parent66cd953514a18477eb49732e40d5c2ab5f1b12c5 (diff)
downloadjemalloc-19ff2cefba48d1ddab8fb52e3d78f309ca2553cf.zip
jemalloc-19ff2cefba48d1ddab8fb52e3d78f309ca2553cf.tar.gz
jemalloc-19ff2cefba48d1ddab8fb52e3d78f309ca2553cf.tar.bz2
Implement the arena.<i>.reset mallctl.
This makes it possible to discard all of an arena's allocations in a single operation. This resolves #146.
Diffstat (limited to 'include')
-rw-r--r--include/jemalloc/internal/arena.h5
-rw-r--r--include/jemalloc/internal/extent.h2
-rw-r--r--include/jemalloc/internal/private_symbols.txt1
3 files changed, 7 insertions, 1 deletions
diff --git a/include/jemalloc/internal/arena.h b/include/jemalloc/internal/arena.h
index 103a4c9..f2685f6 100644
--- a/include/jemalloc/internal/arena.h
+++ b/include/jemalloc/internal/arena.h
@@ -330,6 +330,10 @@ struct arena_s {
dss_prec_t dss_prec;
+
+ /* Extant arena chunks. */
+ ql_head(extent_node_t) achunks;
+
/*
* In order to avoid rapid chunk allocation/deallocation when an arena
* oscillates right on the cusp of needing a new chunk, cache the most
@@ -533,6 +537,7 @@ ssize_t arena_decay_time_get(tsd_t *tsd, arena_t *arena);
bool arena_decay_time_set(tsd_t *tsd, arena_t *arena, ssize_t decay_time);
void arena_purge(tsd_t *tsd, arena_t *arena, bool all);
void arena_maybe_purge(tsd_t *tsd, arena_t *arena);
+void arena_reset(tsd_t *tsd, arena_t *arena);
void arena_tcache_fill_small(tsd_t *tsd, arena_t *arena, tcache_bin_t *tbin,
szind_t binind, uint64_t prof_accumbytes);
void arena_alloc_junk_small(void *ptr, arena_bin_info_t *bin_info,
diff --git a/include/jemalloc/internal/extent.h b/include/jemalloc/internal/extent.h
index 386d50e..49d76a5 100644
--- a/include/jemalloc/internal/extent.h
+++ b/include/jemalloc/internal/extent.h
@@ -48,7 +48,7 @@ struct extent_node_s {
/* Linkage for the size/address-ordered tree. */
rb_node(extent_node_t) szad_link;
- /* Linkage for arena's huge and node_cache lists. */
+ /* Linkage for arena's achunks, huge, and node_cache lists. */
ql_elm(extent_node_t) ql_link;
};
diff --git a/include/jemalloc/internal/private_symbols.txt b/include/jemalloc/internal/private_symbols.txt
index eacc7c6..c7ff852 100644
--- a/include/jemalloc/internal/private_symbols.txt
+++ b/include/jemalloc/internal/private_symbols.txt
@@ -100,6 +100,7 @@ arena_ralloc_junk_large
arena_ralloc_no_move
arena_rd_to_miscelm
arena_redzone_corruption
+arena_reset
arena_run_regind
arena_run_to_miscelm
arena_salloc