Home
last modified time | relevance | path

Searched refs:tsd (Results 1 – 25 of 58) sorted by relevance

123

/external/mesa3d/src/mapi/mapi/
Du_thread.h116 u_tsd_init(struct u_tsd *tsd) in u_tsd_init() argument
118 if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) { in u_tsd_init()
122 tsd->initMagic = INIT_MAGIC; in u_tsd_init()
127 u_tsd_get(struct u_tsd *tsd) in u_tsd_get() argument
129 if (tsd->initMagic != INIT_MAGIC) { in u_tsd_get()
130 u_tsd_init(tsd); in u_tsd_get()
132 return pthread_getspecific(tsd->key); in u_tsd_get()
137 u_tsd_set(struct u_tsd *tsd, void *ptr) in u_tsd_set() argument
139 if (tsd->initMagic != INIT_MAGIC) { in u_tsd_set()
140 u_tsd_init(tsd); in u_tsd_set()
[all …]
/external/jemalloc/src/
Dquarantine.c15 static quarantine_t *quarantine_grow(tsd_t *tsd, quarantine_t *quarantine);
16 static void quarantine_drain_one(tsd_t *tsd, quarantine_t *quarantine);
17 static void quarantine_drain(tsd_t *tsd, quarantine_t *quarantine,
23 quarantine_init(tsd_t *tsd, size_t lg_maxobjs) in quarantine_init() argument
27 assert(tsd_nominal(tsd)); in quarantine_init()
29 quarantine = (quarantine_t *)iallocztm(tsd, offsetof(quarantine_t, objs) in quarantine_init()
31 tcache_get(tsd, true), true, NULL); in quarantine_init()
43 quarantine_alloc_hook_work(tsd_t *tsd) in quarantine_alloc_hook_work() argument
47 if (!tsd_nominal(tsd)) in quarantine_alloc_hook_work()
50 quarantine = quarantine_init(tsd, LG_MAXOBJS_INIT); in quarantine_alloc_hook_work()
[all …]
Djemalloc.c430 arena_bind_locked(tsd_t *tsd, unsigned ind) in arena_bind_locked() argument
437 if (tsd_nominal(tsd)) in arena_bind_locked()
438 tsd_arena_set(tsd, arena); in arena_bind_locked()
442 arena_bind(tsd_t *tsd, unsigned ind) in arena_bind() argument
446 arena_bind_locked(tsd, ind); in arena_bind()
451 arena_migrate(tsd_t *tsd, unsigned oldind, unsigned newind) in arena_migrate() argument
461 tsd_arena_set(tsd, newarena); in arena_migrate()
476 arena_unbind(tsd_t *tsd, unsigned ind) in arena_unbind() argument
484 tsd_arena_set(tsd, NULL); in arena_unbind()
488 arena_get_hard(tsd_t *tsd, unsigned ind, bool init_if_missing) in arena_get_hard() argument
[all …]
Dprof.c125 static void prof_tctx_destroy(tsd_t *tsd, prof_tctx_t *tctx);
128 static void prof_tdata_destroy(tsd_t *tsd, prof_tdata_t *tdata,
130 static char *prof_thread_name_alloc(tsd_t *tsd, const char *thread_name);
190 prof_alloc_rollback(tsd_t *tsd, prof_tctx_t *tctx, bool updated) in rb_gen()
203 tdata = prof_tdata_get(tsd, true); in rb_gen()
212 prof_tctx_destroy(tsd, tctx); in rb_gen()
236 prof_free_sampled_object(tsd_t *tsd, size_t usize, prof_tctx_t *tctx) in prof_free_sampled_object() argument
246 prof_tctx_destroy(tsd, tctx); in prof_free_sampled_object()
262 prof_enter(tsd_t *tsd, prof_tdata_t *tdata) in prof_enter() argument
266 assert(tdata == prof_tdata_get(tsd, false)); in prof_enter()
[all …]
Dtcache.c33 tcache_event_hard(tsd_t *tsd, tcache_t *tcache) in tcache_event_hard() argument
44 tcache_bin_flush_small(tsd, tcache, tbin, binind, in tcache_event_hard()
48 tcache_bin_flush_large(tsd, tbin, binind, tbin->ncached in tcache_event_hard()
74 tcache_alloc_small_hard(tsd_t *tsd, arena_t *arena, tcache_t *tcache, in tcache_alloc_small_hard() argument
89 tcache_bin_flush_small(tsd_t *tsd, tcache_t *tcache, tcache_bin_t *tbin, in tcache_bin_flush_small() argument
100 arena = arena_choose(tsd, NULL); in tcache_bin_flush_small()
169 tcache_bin_flush_large(tsd_t *tsd, tcache_bin_t *tbin, index_t binind, in tcache_bin_flush_large() argument
180 arena = arena_choose(tsd, NULL); in tcache_bin_flush_large()
297 tcache_get_hard(tsd_t *tsd) in tcache_get_hard() argument
302 if (tsd_nominal(tsd)) in tcache_get_hard()
[all …]
Dckh.c43 static bool ckh_grow(tsd_t *tsd, ckh_t *ckh);
44 static void ckh_shrink(tsd_t *tsd, ckh_t *ckh);
246 ckh_grow(tsd_t *tsd, ckh_t *ckh) in ckh_grow() argument
273 tab = (ckhc_t *)ipallocztm(tsd, usize, CACHELINE, true, NULL, in ckh_grow()
286 idalloctm(tsd, tab, tcache_get(tsd, false), true); in ckh_grow()
291 idalloctm(tsd, ckh->tab, tcache_get(tsd, false), true); in ckh_grow()
302 ckh_shrink(tsd_t *tsd, ckh_t *ckh) in ckh_shrink() argument
317 tab = (ckhc_t *)ipallocztm(tsd, usize, CACHELINE, true, NULL, true, in ckh_shrink()
333 idalloctm(tsd, tab, tcache_get(tsd, false), true); in ckh_shrink()
341 idalloctm(tsd, ckh->tab, tcache_get(tsd, false), true); in ckh_shrink()
[all …]
Dhuge.c34 huge_malloc(tsd_t *tsd, arena_t *arena, size_t size, bool zero, in huge_malloc() argument
45 return (huge_palloc(tsd, arena, usize, chunksize, zero, tcache)); in huge_malloc()
49 huge_palloc(tsd_t *tsd, arena_t *arena, size_t usize, size_t alignment, in huge_palloc() argument
59 node = ipallocztm(tsd, CACHELINE_CEILING(sizeof(extent_node_t)), in huge_palloc()
77 arena = arena_choose(tsd, arena); in huge_palloc()
82 idalloctm(tsd, node, tcache, true); in huge_palloc()
90 idalloctm(tsd, node, tcache, true); in huge_palloc()
329 huge_ralloc(tsd_t *tsd, arena_t *arena, void *ptr, size_t oldsize, size_t size, in huge_ralloc() argument
345 ret = huge_palloc(tsd, arena, size + extra, alignment, zero, in huge_ralloc()
348 ret = huge_malloc(tsd, arena, size + extra, zero, tcache); in huge_ralloc()
[all …]
Dtsd.c73 tsd_t *tsd = (tsd_t *)arg; in tsd_cleanup() local
75 switch (tsd->state) { in tsd_cleanup()
78 n##_cleanup(tsd); in tsd_cleanup()
81 tsd->state = tsd_state_purgatory; in tsd_cleanup()
82 tsd_set(tsd); in tsd_cleanup()
98 tsd->state = tsd_state_purgatory; in tsd_cleanup()
99 tsd_set(tsd); in tsd_cleanup()
/external/jemalloc/include/jemalloc/internal/
Dtcache.h139 void tcache_event_hard(tsd_t *tsd, tcache_t *tcache);
140 void *tcache_alloc_small_hard(tsd_t *tsd, arena_t *arena, tcache_t *tcache,
142 void tcache_bin_flush_small(tsd_t *tsd, tcache_t *tcache, tcache_bin_t *tbin,
144 void tcache_bin_flush_large(tsd_t *tsd, tcache_bin_t *tbin, index_t binind,
150 tcache_t *tcache_get_hard(tsd_t *tsd);
151 tcache_t *tcache_create(tsd_t *tsd, arena_t *arena);
152 void tcache_cleanup(tsd_t *tsd);
153 void tcache_enabled_cleanup(tsd_t *tsd);
155 bool tcaches_create(tsd_t *tsd, unsigned *r_ind);
156 void tcaches_flush(tsd_t *tsd, unsigned ind);
[all …]
Djemalloc_internal.h444 arena_t *arena_get_hard(tsd_t *tsd, unsigned ind, bool init_if_missing);
445 arena_t *arena_choose_hard(tsd_t *tsd);
446 void arena_migrate(tsd_t *tsd, unsigned oldind, unsigned newind);
448 void thread_allocated_cleanup(tsd_t *tsd);
449 void thread_deallocated_cleanup(tsd_t *tsd);
450 void arena_cleanup(tsd_t *tsd);
451 void arenas_cache_cleanup(tsd_t *tsd);
452 void narenas_cache_cleanup(tsd_t *tsd);
453 void arenas_cache_bypass_cleanup(tsd_t *tsd);
513 arena_t *arena_choose(tsd_t *tsd, arena_t *arena);
[all …]
Dprof.h282 void prof_alloc_rollback(tsd_t *tsd, prof_tctx_t *tctx, bool updated);
285 void prof_free_sampled_object(tsd_t *tsd, size_t usize, prof_tctx_t *tctx);
288 prof_tctx_t *prof_lookup(tsd_t *tsd, prof_bt_t *bt);
301 prof_tdata_t *prof_tdata_init(tsd_t *tsd);
302 prof_tdata_t *prof_tdata_reinit(tsd_t *tsd, prof_tdata_t *tdata);
303 void prof_reset(tsd_t *tsd, size_t lg_sample);
304 void prof_tdata_cleanup(tsd_t *tsd);
308 int prof_thread_name_set(tsd_t *tsd, const char *thread_name);
330 prof_tdata_t *prof_tdata_get(tsd_t *tsd, bool create);
331 bool prof_sample_accum_update(tsd_t *tsd, size_t usize, bool commit,
[all …]
Djemalloc_internal.h.in356 #include "jemalloc/internal/tsd.h"
401 #include "jemalloc/internal/tsd.h"
444 arena_t *arena_get_hard(tsd_t *tsd, unsigned ind, bool init_if_missing);
445 arena_t *arena_choose_hard(tsd_t *tsd);
446 void arena_migrate(tsd_t *tsd, unsigned oldind, unsigned newind);
448 void thread_allocated_cleanup(tsd_t *tsd);
449 void thread_deallocated_cleanup(tsd_t *tsd);
450 void arena_cleanup(tsd_t *tsd);
451 void arenas_cache_cleanup(tsd_t *tsd);
452 void narenas_cache_cleanup(tsd_t *tsd);
[all …]
Dquarantine.h32 void quarantine_alloc_hook_work(tsd_t *tsd);
33 void quarantine(tsd_t *tsd, void *ptr);
34 void quarantine_cleanup(tsd_t *tsd);
48 tsd_t *tsd; in quarantine_alloc_hook() local
52 tsd = tsd_fetch(); in quarantine_alloc_hook()
53 if (tsd_quarantine_get(tsd) == NULL) in quarantine_alloc_hook()
54 quarantine_alloc_hook_work(tsd); in quarantine_alloc_hook()
Dtsd.h598 bool tsd_nominal(tsd_t *tsd);
600 t *tsd_##n##p_get(tsd_t *tsd); \
601 t tsd_##n##_get(tsd_t *tsd); \
602 void tsd_##n##_set(tsd_t *tsd, t n);
614 tsd_t *tsd = tsd_get(); in tsd_fetch() local
616 if (unlikely(tsd->state != tsd_state_nominal)) { in tsd_fetch()
617 if (tsd->state == tsd_state_uninitialized) { in tsd_fetch()
618 tsd->state = tsd_state_nominal; in tsd_fetch()
620 tsd_set(tsd); in tsd_fetch()
621 } else if (tsd->state == tsd_state_purgatory) { in tsd_fetch()
[all …]
Dhuge.h12 void *huge_malloc(tsd_t *tsd, arena_t *arena, size_t size, bool zero,
14 void *huge_palloc(tsd_t *tsd, arena_t *arena, size_t usize, size_t alignment,
18 void *huge_ralloc(tsd_t *tsd, arena_t *arena, void *ptr, size_t oldsize,
25 void huge_dalloc(tsd_t *tsd, void *ptr, tcache_t *tcache);
Dckh.h69 bool ckh_new(tsd_t *tsd, ckh_t *ckh, size_t minitems, ckh_hash_t *hash,
71 void ckh_delete(tsd_t *tsd, ckh_t *ckh);
74 bool ckh_insert(tsd_t *tsd, ckh_t *ckh, const void *key, const void *data);
75 bool ckh_remove(tsd_t *tsd, ckh_t *ckh, const void *searchkey, void **key,
/external/jemalloc/test/unit/
Dckh.c5 tsd_t *tsd; in TEST_BEGIN() local
8 tsd = tsd_fetch(); in TEST_BEGIN()
10 assert_false(ckh_new(tsd, &ckh, 2, ckh_string_hash, ckh_string_keycomp), in TEST_BEGIN()
12 ckh_delete(tsd, &ckh); in TEST_BEGIN()
14 assert_false(ckh_new(tsd, &ckh, 3, ckh_pointer_hash, in TEST_BEGIN()
16 ckh_delete(tsd, &ckh); in TEST_BEGIN()
22 tsd_t *tsd; in TEST_BEGIN() local
33 tsd = tsd_fetch(); in TEST_BEGIN()
35 assert_false(ckh_new(tsd, &ckh, 2, ckh_string_hash, ckh_string_keycomp), in TEST_BEGIN()
43 ckh_insert(tsd, &ckh, strs[i], strs[i]); in TEST_BEGIN()
[all …]
/external/toybox/toys/pending/
Dsyslogd.c408 struct unsocks *tsd; in syslogd_main() local
420 tsd = xzalloc(sizeof(struct unsocks)); in syslogd_main()
422 tsd->path = (toys.optflags & FLAG_p) ? TT.unix_socket : "/dev/log"; // DEFLOGSOCK in syslogd_main()
423 TT.lsocks = tsd; in syslogd_main()
428 tsd = xzalloc(sizeof(struct unsocks)); in syslogd_main()
429 tsd->path = temp; in syslogd_main()
430 tsd->next = TT.lsocks; in syslogd_main()
431 TT.lsocks = tsd; in syslogd_main()
440 for (tsd = TT.lsocks; tsd; tsd = tsd->next) { in syslogd_main()
441 tsd->sdu.sun_family = AF_UNIX; in syslogd_main()
[all …]
/external/mesa3d/src/mapi/glapi/
Dglthread.h16 #define _glthread_InitTSD(tsd) u_tsd_init(tsd); argument
17 #define _glthread_DestroyTSD(tsd) u_tsd_destroy(tsd); argument
18 #define _glthread_GetTSD(tsd) u_tsd_get(tsd); argument
19 #define _glthread_SetTSD(tsd, ptr) u_tsd_set(tsd, ptr); argument
/external/compiler-rt/lib/asan/
Dasan_posix.cc86 void AsanTSDInit(void (*destructor)(void *tsd)) { in AsanTSDInit() argument
97 void AsanTSDSet(void *tsd) { in AsanTSDSet() argument
99 pthread_setspecific(tsd_key, tsd); in AsanTSDSet()
102 void PlatformTSDDtor(void *tsd) { in PlatformTSDDtor() argument
103 AsanThreadContext *context = (AsanThreadContext*)tsd; in PlatformTSDDtor()
106 CHECK_EQ(0, pthread_setspecific(tsd_key, tsd)); in PlatformTSDDtor()
109 AsanThread::TSDDtor(tsd); in PlatformTSDDtor()
Dasan_win.cc157 void AsanTSDInit(void (*destructor)(void *tsd)) { in AsanTSDInit() argument
167 void AsanTSDSet(void *tsd) { in AsanTSDSet() argument
169 fake_tsd = tsd; in AsanTSDSet()
172 void PlatformTSDDtor(void *tsd) { in PlatformTSDDtor() argument
173 AsanThread::TSDDtor(tsd); in PlatformTSDDtor()
Dasan_internal.h87 void AsanTSDInit(void (*destructor)(void *tsd));
89 void AsanTSDSet(void *tsd);
90 void PlatformTSDDtor(void *tsd);
/external/mesa3d/src/gallium/auxiliary/os/
Dos_thread.h459 pipe_tsd_init(pipe_tsd *tsd) in pipe_tsd_init() argument
462 if (pthread_key_create(&tsd->key, NULL/*free*/) != 0) { in pipe_tsd_init()
469 tsd->initMagic = PIPE_TSD_INIT_MAGIC; in pipe_tsd_init()
473 pipe_tsd_get(pipe_tsd *tsd) in pipe_tsd_get() argument
475 if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) { in pipe_tsd_get()
476 pipe_tsd_init(tsd); in pipe_tsd_get()
479 return pthread_getspecific(tsd->key); in pipe_tsd_get()
490 pipe_tsd_set(pipe_tsd *tsd, void *value) in pipe_tsd_set() argument
492 if (tsd->initMagic != (int) PIPE_TSD_INIT_MAGIC) { in pipe_tsd_set()
493 pipe_tsd_init(tsd); in pipe_tsd_set()
[all …]
/external/libxml2/
Dthreads.c671 xmlGlobalState *tsd = xmlNewGlobalState(); in xmlGetGlobalState() local
672 if (tsd == NULL) in xmlGetGlobalState()
675 pthread_setspecific(globalkey, tsd); in xmlGetGlobalState()
676 return (tsd); in xmlGetGlobalState()
698 xmlGlobalState *tsd = xmlNewGlobalState(); in xmlGetGlobalState()
700 if (tsd == NULL) in xmlGetGlobalState()
707 xmlFreeGlobalState(tsd); in xmlGetGlobalState()
710 p->memory = tsd; in xmlGetGlobalState()
715 TlsSetValue(globalkey, tsd); in xmlGetGlobalState()
729 return (tsd); in xmlGetGlobalState()
[all …]
/external/compiler-rt/lib/msan/
Dmsan_linux.cc159 void MsanTSDInit(void (*destructor)(void *tsd)) { in MsanTSDInit() argument
180 void MsanTSDDtor(void *tsd) { in MsanTSDDtor() argument
181 MsanThread *t = (MsanThread*)tsd; in MsanTSDDtor()
184 CHECK_EQ(0, pthread_setspecific(tsd_key, tsd)); in MsanTSDDtor()
190 MsanThread::TSDDtor(tsd); in MsanTSDDtor()

123