* Imported Boehm-GC 7.1.
[cacao.git] / src / mm / boehm-gc / include / private / thread_local_alloc.h
index 4c2c5362fbcf422bdf0db0afdcc83dfe12fb35ae..90a246a0eaed384cf3e768f58a6fa5be91152bcc 100644 (file)
@@ -109,7 +109,9 @@ typedef struct thread_local_freelists {
        /* We assume 0 == success, msft does the opposite.      */
 #   define GC_key_create(key, d)  \
        ((d) != 0? (ABORT("Destructor unsupported by TlsAlloc"),0) \
-                : (*(key) = TlsAlloc(), 0))
+                : ((*(key) = TlsAlloc()) == TLS_OUT_OF_INDEXES? \
+                      (ABORT("Out of tls"), 0): \
+                      0))
 #   define GC_remove_specific(key)  /* No need for cleanup on thread exit. */
        /* Need TlsFree on process exit/detach ? */
     typedef DWORD GC_key_t;