diff options
Diffstat (limited to 'thread_local_alloc.c')
-rw-r--r-- | thread_local_alloc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/thread_local_alloc.c b/thread_local_alloc.c index 26b76990..ae1286db 100644 --- a/thread_local_alloc.c +++ b/thread_local_alloc.c @@ -157,13 +157,16 @@ GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc_kind(size_t bytes, int knd) } # endif # if !defined(USE_PTHREAD_SPECIFIC) && !defined(USE_WIN32_SPECIFIC) + { GC_key_t k = GC_thread_key; + if (EXPECT(0 == k, FALSE)) { /* We haven't yet run GC_init_parallel. That means */ /* we also aren't locking, so this is fairly cheap. */ return GC_malloc_kind_global(bytes, knd); } tsd = GC_getspecific(k); + } # else tsd = GC_getspecific(GC_thread_key); # endif |