summaryrefslogtreecommitdiff
path: root/thread_local_alloc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-11-15 11:44:29 +0100
committerIvan Maidanski <ivmai@mail.ru>2011-11-15 12:51:34 +0100
commit5651cb612de85c8c84773da02213e8fe3a45754d (patch)
tree69deaaf24c7befe701997b754459b15b5b07ef46 /thread_local_alloc.c
parent0c3964c10770b766765aa1a6084d3ddfa7da1024 (diff)
Fix thread_local_alloc GC_malloc[_atomic] for USE_CUSTOM_SPECIFIC TLS
platforms (e.g., Solaris) * thread_local_alloc.c (GC_malloc, GC_malloc_atomic): Test result of GC_getspecific() for NULL in all cases except for USE_COMPILER_TLS and USE_WIN32_COMPILER_TLS (i.e., no-op implementation of GC_getspecific).
Diffstat (limited to 'thread_local_alloc.c')
-rw-r--r--thread_local_alloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/thread_local_alloc.c b/thread_local_alloc.c
index 610db6f..0a49b94 100644
--- a/thread_local_alloc.c
+++ b/thread_local_alloc.c
@@ -147,6 +147,8 @@ 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_COMPILER_TLS) && !defined(USE_WIN32_COMPILER_TLS)
if (EXPECT(0 == tsd, FALSE)) {
return GC_core_malloc(bytes);
}
@@ -182,6 +184,8 @@ GC_API void * GC_CALL GC_malloc_atomic(size_t bytes)
tsd = GC_getspecific(k);
# else
tsd = GC_getspecific(GC_thread_key);
+# endif
+# if !defined(USE_COMPILER_TLS) && !defined(USE_WIN32_COMPILER_TLS)
if (EXPECT(0 == tsd, FALSE)) {
return GC_core_malloc_atomic(bytes);
}