]> granicus.if.org Git - gc/commitdiff
Darwin/AMD64 can have 64-bit thread id's, so we need to ensure we cast properly to...
authorGeoff Norton <grompf@gmail.com>
Wed, 3 Aug 2011 01:45:49 +0000 (21:45 -0400)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 4 Mar 2012 12:01:04 +0000 (16:01 +0400)
include/private/gc_priv.h
pthread_support.c

index d1993d442594d50746da6a39ffb0865c03e9df24..da49c0a4952432511118edb1c15d8885bf4f4eae 100644 (file)
@@ -371,6 +371,8 @@ void GC_print_callers GC_PROTO((struct callinfo info[NFRAMES]));
 #              define GC_MACH_THREAD_STATE_FLAVOR PPC_THREAD_STATE
 #      elif defined(I386)
 #              define GC_MACH_THREAD_STATE_FLAVOR i386_THREAD_STATE
+#      elif defined(X86_64)
+#              define GC_MACH_THREAD_STATE_FLAVOR x86_THREAD_STATE64
 #      else
 #              define GC_MACH_THREAD_STATE_FLAVOR MACHINE_THREAD_STATE
 #      endif
index 3e588ace211abdcd0ed62b104f94f2a57d8b336b..96e8a011b2ca5ece50e39695416fa5fdedeb56a5 100644 (file)
@@ -729,7 +729,7 @@ void nacl_shutdown_gc_thread()
 /* Caller holds allocation lock.                                       */
 GC_thread GC_new_thread(pthread_t id)
 {
-    int hv = ((word)id) % THREAD_TABLE_SZ;
+    int hv = ((unsigned long)id) % THREAD_TABLE_SZ;
     GC_thread result;
     static GC_bool first_thread_used = FALSE;
     
@@ -760,7 +760,7 @@ GC_thread GC_new_thread(pthread_t id)
 /* Caller holds allocation lock.                               */
 void GC_delete_thread(pthread_t id)
 {
-    int hv = ((word)id) % THREAD_TABLE_SZ;
+    int hv = ((unsigned long)id) % THREAD_TABLE_SZ;
     register GC_thread p = GC_threads[hv];
     register GC_thread prev = 0;
     
@@ -796,7 +796,7 @@ void GC_delete_thread(pthread_t id)
 /* This is OK, but we need a way to delete a specific one.     */
 void GC_delete_gc_thread(pthread_t id, GC_thread gc_id)
 {
-    int hv = ((word)id) % THREAD_TABLE_SZ;
+    int hv = ((unsigned long)id) % THREAD_TABLE_SZ;
     register GC_thread p = GC_threads[hv];
     register GC_thread prev = 0;
 
@@ -825,7 +825,7 @@ void GC_delete_gc_thread(pthread_t id, GC_thread gc_id)
 /* return the most recent one.                                 */
 GC_thread GC_lookup_thread(pthread_t id)
 {
-    int hv = ((word)id) % THREAD_TABLE_SZ;
+    int hv = ((unsigned long)id) % THREAD_TABLE_SZ;
     register GC_thread p = GC_threads[hv];
     
     while (p != 0 && !pthread_equal(p -> id, id)) p = p -> next;