summaryrefslogtreecommitdiff
path: root/thread_local_alloc.c
diff options
context:
space:
mode:
authorivmai <ivmai>2011-05-10 17:39:29 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:58 +0200
commitd604870504cc8dd8870e8c1a6e719f88eb6c5ba7 (patch)
treeacae89b7d43b8ebc49baea0a8fd62671a4672ea7 /thread_local_alloc.c
parentff325b9a6bf206b951bc30beb12c96d8de2e6334 (diff)
2011-05-10 Ivan Maidanski <ivmai@mail.ru>
* thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Join adjacent "#ifdef". * thread_local_alloc.c (GC_malloc_atomic): Call GC_core_malloc_atomic (instead of GC_core_malloc).
Diffstat (limited to 'thread_local_alloc.c')
-rw-r--r--thread_local_alloc.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/thread_local_alloc.c b/thread_local_alloc.c
index 2e27331..1540f9f 100644
--- a/thread_local_alloc.c
+++ b/thread_local_alloc.c
@@ -147,8 +147,6 @@ GC_API void * GC_CALL GC_malloc(size_t bytes)
tsd = GC_getspecific(k);
# else
tsd = GC_getspecific(GC_thread_key);
-# endif
-# if defined(USE_PTHREAD_SPECIFIC) || defined(USE_WIN32_SPECIFIC)
if (EXPECT(0 == tsd, FALSE)) {
return GC_core_malloc(bytes);
}
@@ -179,15 +177,13 @@ GC_API void * GC_CALL GC_malloc_atomic(size_t bytes)
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_core_malloc(bytes);
+ return GC_core_malloc_atomic(bytes);
}
tsd = GC_getspecific(k);
# else
tsd = GC_getspecific(GC_thread_key);
-# endif
-# if defined(USE_PTHREAD_SPECIFIC) || defined(USE_WIN32_SPECIFIC)
if (EXPECT(0 == tsd, FALSE)) {
- return GC_core_malloc(bytes);
+ return GC_core_malloc_atomic(bytes);
}
# endif
GC_ASSERT(GC_is_initialized);