Home
last modified time | relevance | path

Searched refs:tsdn (Results 1 – 25 of 28) sorted by relevance

12

/external/jemalloc/test/unit/
Dwitness.c63 tsdn_t *tsdn; in TEST_BEGIN() local
67 tsdn = tsdn_fetch(); in TEST_BEGIN()
69 witness_assert_lockless(tsdn); in TEST_BEGIN()
72 witness_assert_not_owner(tsdn, &a); in TEST_BEGIN()
73 witness_lock(tsdn, &a); in TEST_BEGIN()
74 witness_assert_owner(tsdn, &a); in TEST_BEGIN()
77 witness_assert_not_owner(tsdn, &b); in TEST_BEGIN()
78 witness_lock(tsdn, &b); in TEST_BEGIN()
79 witness_assert_owner(tsdn, &b); in TEST_BEGIN()
81 witness_unlock(tsdn, &a); in TEST_BEGIN()
[all …]
Darena_reset.c89 tsdn_t *tsdn; in TEST_BEGIN() local
127 tsdn = tsdn_fetch(); in TEST_BEGIN()
131 assert_zu_gt(ivsalloc(tsdn, ptrs[i], false), 0, in TEST_BEGIN()
145 assert_zu_eq(ivsalloc(tsdn, ptrs[i], false), 0, in TEST_BEGIN()
/external/jemalloc/src/
Dhuge.c18 huge_node_set(tsdn_t *tsdn, const void *ptr, extent_node_t *node) in huge_node_set() argument
23 return (chunk_register(tsdn, ptr, node)); in huge_node_set()
27 huge_node_reset(tsdn_t *tsdn, const void *ptr, extent_node_t *node) in huge_node_reset() argument
31 err = huge_node_set(tsdn, ptr, node); in huge_node_reset()
43 huge_malloc(tsdn_t *tsdn, arena_t *arena, size_t usize, bool zero) in huge_malloc() argument
48 return (huge_palloc(tsdn, arena, usize, chunksize, zero)); in huge_malloc()
52 huge_palloc(tsdn_t *tsdn, arena_t *arena, size_t usize, size_t alignment, in huge_palloc() argument
64 assert(!tsdn_null(tsdn) || arena != NULL); in huge_palloc()
72 iarena = (!tsdn_null(tsdn)) ? arena_ichoose(tsdn_tsd(tsdn), NULL) : in huge_palloc()
74 node = ipallocztm(tsdn, CACHELINE_CEILING(sizeof(extent_node_t)), in huge_palloc()
[all …]
Dbase.c18 base_node_try_alloc(tsdn_t *tsdn) in base_node_try_alloc() argument
22 malloc_mutex_assert_owner(tsdn, &base_mtx); in base_node_try_alloc()
33 base_node_dalloc(tsdn_t *tsdn, extent_node_t *node) in base_node_dalloc() argument
36 malloc_mutex_assert_owner(tsdn, &base_mtx); in base_node_dalloc()
52 base_chunk_alloc(tsdn_t *tsdn, size_t minsize) in base_chunk_alloc() argument
58 malloc_mutex_assert_owner(tsdn, &base_mtx); in base_chunk_alloc()
60 node = base_node_try_alloc(tsdn); in base_chunk_alloc()
67 base_node_dalloc(tsdn, node); in base_chunk_alloc()
90 base_alloc(tsdn_t *tsdn, size_t size) in base_alloc() argument
105 malloc_mutex_lock(tsdn, &base_mtx); in base_alloc()
[all …]
Dchunk.c52 static void chunk_record(tsdn_t *tsdn, arena_t *arena,
67 chunk_hooks_get(tsdn_t *tsdn, arena_t *arena) in chunk_hooks_get() argument
71 malloc_mutex_lock(tsdn, &arena->chunks_mtx); in chunk_hooks_get()
73 malloc_mutex_unlock(tsdn, &arena->chunks_mtx); in chunk_hooks_get()
79 chunk_hooks_set(tsdn_t *tsdn, arena_t *arena, const chunk_hooks_t *chunk_hooks) in chunk_hooks_set() argument
83 malloc_mutex_lock(tsdn, &arena->chunks_mtx); in chunk_hooks_set()
108 malloc_mutex_unlock(tsdn, &arena->chunks_mtx); in chunk_hooks_set()
114 chunk_hooks_assure_initialized_impl(tsdn_t *tsdn, arena_t *arena, in chunk_hooks_assure_initialized_impl() argument
123 chunk_hooks_get(tsdn, arena); in chunk_hooks_assure_initialized_impl()
128 chunk_hooks_assure_initialized_locked(tsdn_t *tsdn, arena_t *arena, in chunk_hooks_assure_initialized_locked() argument
[all …]
Darena.c33 static void arena_chunk_dalloc(tsdn_t *tsdn, arena_t *arena,
35 static void arena_purge_to_limit(tsdn_t *tsdn, arena_t *arena,
37 static void arena_run_dalloc(tsdn_t *tsdn, arena_t *arena, arena_run_t *run,
39 static void arena_dalloc_bin_run(tsdn_t *tsdn, arena_t *arena,
571 arena_chunk_register(tsdn_t *tsdn, arena_t *arena, arena_chunk_t *chunk, in arena_chunk_register() argument
583 return (chunk_register(tsdn, chunk, &chunk->node)); in arena_chunk_register()
587 arena_chunk_alloc_internal_hard(tsdn_t *tsdn, arena_t *arena, in arena_chunk_alloc_internal_hard() argument
593 malloc_mutex_unlock(tsdn, &arena->lock); in arena_chunk_alloc_internal_hard()
595 chunk = (arena_chunk_t *)chunk_alloc_wrapper(tsdn, arena, chunk_hooks, in arena_chunk_alloc_internal_hard()
601 chunk_dalloc_wrapper(tsdn, arena, chunk_hooks, in arena_chunk_alloc_internal_hard()
[all …]
Dprof.c124 static bool prof_tctx_should_destroy(tsdn_t *tsdn, prof_tctx_t *tctx);
126 static bool prof_tdata_should_destroy(tsdn_t *tsdn, prof_tdata_t *tdata,
130 static char *prof_thread_name_alloc(tsdn_t *tsdn, const char *thread_name);
226 prof_malloc_sample_object(tsdn_t *tsdn, const void *ptr, size_t usize, in prof_malloc_sample_object() argument
230 prof_tctx_set(tsdn, ptr, usize, tctx); in prof_malloc_sample_object()
232 malloc_mutex_lock(tsdn, tctx->tdata->lock); in prof_malloc_sample_object()
240 malloc_mutex_unlock(tsdn, tctx->tdata->lock); in prof_malloc_sample_object()
550 prof_gctx_create(tsdn_t *tsdn, prof_bt_t *bt) in prof_gctx_create() argument
556 prof_gctx_t *gctx = (prof_gctx_t *)iallocztm(tsdn, size, in prof_gctx_create()
612 prof_tctx_should_destroy(tsdn_t *tsdn, prof_tctx_t *tctx) in prof_tctx_should_destroy() argument
[all …]
Dtcache.c30 tcache_salloc(tsdn_t *tsdn, const void *ptr) in tcache_salloc() argument
33 return (arena_salloc(tsdn, ptr, false)); in tcache_salloc()
77 tcache_alloc_small_hard(tsdn_t *tsdn, arena_t *arena, tcache_t *tcache, in tcache_alloc_small_hard() argument
82 arena_tcache_fill_small(tsdn, arena, tbin, binind, config_prof ? in tcache_alloc_small_hard()
259 tcache_arena_associate(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena) in tcache_arena_associate() argument
264 malloc_mutex_lock(tsdn, &arena->lock); in tcache_arena_associate()
267 malloc_mutex_unlock(tsdn, &arena->lock); in tcache_arena_associate()
272 tcache_arena_dissociate(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena) in tcache_arena_dissociate() argument
277 malloc_mutex_lock(tsdn, &arena->lock); in tcache_arena_dissociate()
290 tcache_stats_merge(tsdn, tcache, arena); in tcache_arena_dissociate()
[all …]
Djemalloc.c438 arena_init_locked(tsdn_t *tsdn, unsigned ind) in arena_init_locked() argument
452 arena = arena_get(tsdn, ind, false); in arena_init_locked()
459 arena = arena_new(tsdn, ind); in arena_init_locked()
465 arena_init(tsdn_t *tsdn, unsigned ind) in arena_init() argument
469 malloc_mutex_lock(tsdn, &arenas_lock); in arena_init()
470 arena = arena_init_locked(tsdn, ind); in arena_init()
471 malloc_mutex_unlock(tsdn, &arenas_lock); in arena_init()
751 tsdn_t *tsdn; in stats_print_atexit() local
754 tsdn = tsdn_fetch(); in stats_print_atexit()
764 arena_t *arena = arena_get(tsdn, i, false); in stats_print_atexit()
[all …]
Dquarantine.c16 static void quarantine_drain_one(tsdn_t *tsdn, quarantine_t *quarantine);
17 static void quarantine_drain(tsdn_t *tsdn, quarantine_t *quarantine,
23 quarantine_init(tsdn_t *tsdn, size_t lg_maxobjs) in quarantine_init() argument
30 quarantine = (quarantine_t *)iallocztm(tsdn, size, size2index(size), in quarantine_init()
97 quarantine_drain_one(tsdn_t *tsdn, quarantine_t *quarantine) in quarantine_drain_one() argument
100 assert(obj->usize == isalloc(tsdn, obj->ptr, config_prof)); in quarantine_drain_one()
101 idalloctm(tsdn, obj->ptr, NULL, false, true); in quarantine_drain_one()
109 quarantine_drain(tsdn_t *tsdn, quarantine_t *quarantine, size_t upper_bound) in quarantine_drain() argument
113 quarantine_drain_one(tsdn, quarantine); in quarantine_drain()
Dmutex.c114 malloc_mutex_prefork(tsdn_t *tsdn, malloc_mutex_t *mutex) in malloc_mutex_prefork() argument
117 malloc_mutex_lock(tsdn, mutex); in malloc_mutex_prefork()
121 malloc_mutex_postfork_parent(tsdn_t *tsdn, malloc_mutex_t *mutex) in malloc_mutex_postfork_parent() argument
124 malloc_mutex_unlock(tsdn, mutex); in malloc_mutex_postfork_parent()
128 malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t *mutex) in malloc_mutex_postfork_child() argument
132 malloc_mutex_unlock(tsdn, mutex); in malloc_mutex_postfork_child()
Dctl.c49 static const ctl_named_node_t *n##_index(tsdn_t *tsdn, \
54 static void ctl_arena_stats_amerge(tsdn_t *tsdn, ctl_arena_stats_t *cstats,
58 static void ctl_arena_refresh(tsdn_t *tsdn, arena_t *arena, unsigned i);
59 static bool ctl_grow(tsdn_t *tsdn);
60 static void ctl_refresh(tsdn_t *tsdn);
61 static bool ctl_init(tsdn_t *tsdn);
62 static int ctl_lookup(tsdn_t *tsdn, const char *name,
120 static void arena_i_purge(tsdn_t *tsdn, unsigned arena_ind, bool all);
563 ctl_arena_stats_amerge(tsdn_t *tsdn, ctl_arena_stats_t *cstats, arena_t *arena) in ctl_arena_stats_amerge() argument
568 arena_stats_merge(tsdn, arena, &cstats->nthreads, &cstats->dss, in ctl_arena_stats_amerge()
[all …]
/external/jemalloc/include/jemalloc/internal/
Dwitness.h113 void witness_assert_owner(tsdn_t *tsdn, const witness_t *witness);
114 void witness_assert_not_owner(tsdn_t *tsdn, const witness_t *witness);
115 void witness_assert_lockless(tsdn_t *tsdn);
116 void witness_lock(tsdn_t *tsdn, witness_t *witness);
117 void witness_unlock(tsdn_t *tsdn, witness_t *witness);
137 witness_assert_owner(tsdn_t *tsdn, const witness_t *witness) in witness_assert_owner() argument
144 if (tsdn_null(tsdn)) in witness_assert_owner()
146 tsd = tsdn_tsd(tsdn); in witness_assert_owner()
156 witness_assert_not_owner(tsdn_t *tsdn, const witness_t *witness) in witness_assert_not_owner() argument
165 if (tsdn_null(tsdn)) in witness_assert_not_owner()
[all …]
Dmutex.h67 void malloc_mutex_prefork(tsdn_t *tsdn, malloc_mutex_t *mutex);
68 void malloc_mutex_postfork_parent(tsdn_t *tsdn, malloc_mutex_t *mutex);
69 void malloc_mutex_postfork_child(tsdn_t *tsdn, malloc_mutex_t *mutex);
77 void malloc_mutex_lock(tsdn_t *tsdn, malloc_mutex_t *mutex);
78 void malloc_mutex_unlock(tsdn_t *tsdn, malloc_mutex_t *mutex);
79 void malloc_mutex_assert_owner(tsdn_t *tsdn, malloc_mutex_t *mutex);
80 void malloc_mutex_assert_not_owner(tsdn_t *tsdn, malloc_mutex_t *mutex);
85 malloc_mutex_lock(tsdn_t *tsdn, malloc_mutex_t *mutex) in malloc_mutex_lock() argument
89 witness_assert_not_owner(tsdn, &mutex->witness); in malloc_mutex_lock()
103 witness_lock(tsdn, &mutex->witness); in malloc_mutex_lock()
[all …]
Darena.h541 extent_node_t *arena_node_alloc(tsdn_t *tsdn, arena_t *arena);
542 void arena_node_dalloc(tsdn_t *tsdn, arena_t *arena, extent_node_t *node);
543 void *arena_chunk_alloc_huge(tsdn_t *tsdn, arena_t *arena, size_t usize,
545 void arena_chunk_dalloc_huge(tsdn_t *tsdn, arena_t *arena, void *chunk,
547 void arena_chunk_ralloc_huge_similar(tsdn_t *tsdn, arena_t *arena,
549 void arena_chunk_ralloc_huge_shrink(tsdn_t *tsdn, arena_t *arena,
551 bool arena_chunk_ralloc_huge_expand(tsdn_t *tsdn, arena_t *arena,
553 ssize_t arena_lg_dirty_mult_get(tsdn_t *tsdn, arena_t *arena);
554 bool arena_lg_dirty_mult_set(tsdn_t *tsdn, arena_t *arena,
556 ssize_t arena_decay_time_get(tsdn_t *tsdn, arena_t *arena);
[all …]
Dprof.h284 void prof_malloc_sample_object(tsdn_t *tsdn, const void *ptr, size_t usize,
299 void prof_idump(tsdn_t *tsdn);
301 void prof_gdump(tsdn_t *tsdn);
306 bool prof_active_get(tsdn_t *tsdn);
307 bool prof_active_set(tsdn_t *tsdn, bool active);
312 bool prof_thread_active_init_get(tsdn_t *tsdn);
313 bool prof_thread_active_init_set(tsdn_t *tsdn, bool active_init);
314 bool prof_gdump_get(tsdn_t *tsdn);
315 bool prof_gdump_set(tsdn_t *tsdn, bool active);
319 void prof_prefork0(tsdn_t *tsdn);
[all …]
Dhuge.h12 void *huge_malloc(tsdn_t *tsdn, arena_t *arena, size_t usize, bool zero);
13 void *huge_palloc(tsdn_t *tsdn, arena_t *arena, size_t usize,
15 bool huge_ralloc_no_move(tsdn_t *tsdn, void *ptr, size_t oldsize,
23 void huge_dalloc(tsdn_t *tsdn, void *ptr);
25 size_t huge_salloc(tsdn_t *tsdn, const void *ptr);
26 prof_tctx_t *huge_prof_tctx_get(tsdn_t *tsdn, const void *ptr);
27 void huge_prof_tctx_set(tsdn_t *tsdn, const void *ptr, prof_tctx_t *tctx);
28 void huge_prof_tctx_reset(tsdn_t *tsdn, const void *ptr);
Dchunk.h55 chunk_hooks_t chunk_hooks_get(tsdn_t *tsdn, arena_t *arena);
56 chunk_hooks_t chunk_hooks_set(tsdn_t *tsdn, arena_t *arena,
59 bool chunk_register(tsdn_t *tsdn, const void *chunk,
63 void *chunk_alloc_cache(tsdn_t *tsdn, arena_t *arena,
66 void *chunk_alloc_wrapper(tsdn_t *tsdn, arena_t *arena,
69 void chunk_dalloc_cache(tsdn_t *tsdn, arena_t *arena,
72 void chunk_dalloc_wrapper(tsdn_t *tsdn, arena_t *arena,
75 bool chunk_purge_wrapper(tsdn_t *tsdn, arena_t *arena,
Dbase.h12 void *base_alloc(tsdn_t *tsdn, size_t size);
13 void base_stats_get(tsdn_t *tsdn, size_t *allocated, size_t *resident,
16 void base_prefork(tsdn_t *tsdn);
17 void base_postfork_parent(tsdn_t *tsdn);
18 void base_postfork_child(tsdn_t *tsdn);
Djemalloc_internal.h489 arena_t *arena_init(tsdn_t *tsdn, unsigned ind);
581 arena_t *arena_get(tsdn_t *tsdn, unsigned ind, bool init_if_missing);
948 arena_get(tsdn_t *tsdn, unsigned ind, bool init_if_missing) in arena_get() argument
958 ret = arena_init(tsdn, ind); in arena_get()
992 size_t isalloc(tsdn_t *tsdn, const void *ptr, bool demote);
993 void *iallocztm(tsdn_t *tsdn, size_t size, szind_t ind, bool zero,
997 void *ipallocztm(tsdn_t *tsdn, size_t usize, size_t alignment, bool zero,
999 void *ipalloct(tsdn_t *tsdn, size_t usize, size_t alignment, bool zero,
1002 size_t ivsalloc(tsdn_t *tsdn, const void *ptr, bool demote);
1004 size_t p2rz(tsdn_t *tsdn, const void *ptr);
[all …]
Dvalgrind.h33 #define JEMALLOC_VALGRIND_MALLOC(cond, tsdn, ptr, usize, zero) do { \ argument
35 VALGRIND_MALLOCLIKE_BLOCK(ptr, usize, p2rz(tsdn, ptr), \
51 #define JEMALLOC_VALGRIND_REALLOC(moved, tsdn, ptr, usize, ptr_null, \ argument
54 size_t rzsize = p2rz(tsdn, ptr); \
100 #define JEMALLOC_VALGRIND_MALLOC(cond, tsdn, ptr, usize, zero) do {} while (0) argument
101 #define JEMALLOC_VALGRIND_REALLOC(maybe_moved, tsdn, ptr, usize, \ argument
Dctl.h75 int ctl_nametomib(tsdn_t *tsdn, const char *name, size_t *mibp,
81 void ctl_prefork(tsdn_t *tsdn);
82 void ctl_postfork_parent(tsdn_t *tsdn);
83 void ctl_postfork_child(tsdn_t *tsdn);
Djemalloc_internal.h.in489 arena_t *arena_init(tsdn_t *tsdn, unsigned ind);
581 arena_t *arena_get(tsdn_t *tsdn, unsigned ind, bool init_if_missing);
948 arena_get(tsdn_t *tsdn, unsigned ind, bool init_if_missing) argument
958 ret = arena_init(tsdn, ind);
992 size_t isalloc(tsdn_t *tsdn, const void *ptr, bool demote);
993 void *iallocztm(tsdn_t *tsdn, size_t size, szind_t ind, bool zero,
997 void *ipallocztm(tsdn_t *tsdn, size_t usize, size_t alignment, bool zero,
999 void *ipalloct(tsdn_t *tsdn, size_t usize, size_t alignment, bool zero,
1002 size_t ivsalloc(tsdn_t *tsdn, const void *ptr, bool demote);
1004 size_t p2rz(tsdn_t *tsdn, const void *ptr);
[all …]
Dtcache.h145 size_t tcache_salloc(tsdn_t *tsdn, const void *ptr);
147 void *tcache_alloc_small_hard(tsdn_t *tsdn, arena_t *arena, tcache_t *tcache,
153 void tcache_arena_reassociate(tsdn_t *tsdn, tcache_t *tcache,
156 tcache_t *tcache_create(tsdn_t *tsdn, arena_t *arena);
159 void tcache_stats_merge(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena);
163 bool tcache_boot(tsdn_t *tsdn);
164 void tcache_prefork(tsdn_t *tsdn);
165 void tcache_postfork_parent(tsdn_t *tsdn);
166 void tcache_postfork_child(tsdn_t *tsdn);
Dtsd.h681 bool tsdn_null(const tsdn_t *tsdn);
682 tsd_t *tsdn_tsd(tsdn_t *tsdn);
770 tsdn_null(const tsdn_t *tsdn) in tsdn_null() argument
773 return (tsdn == NULL); in tsdn_null()
777 tsdn_tsd(tsdn_t *tsdn) in tsdn_tsd() argument
780 assert(!tsdn_null(tsdn)); in tsdn_tsd()
782 return (&tsdn->tsd); in tsdn_tsd()

12