[pypy-commit] stm default: Fix the warnings given by 'make build-demo1'.

arigo noreply at buildbot.pypy.org
Sat May 25 17:02:09 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r4:6333ea8539f3
Date: 2013-05-25 17:02 +0200
http://bitbucket.org/pypy/stm/changeset/6333ea8539f3/

Log:	Fix the warnings given by 'make build-demo1'.

diff --git a/c3/et.c b/c3/et.c
--- a/c3/et.c
+++ b/c3/et.c
@@ -321,6 +321,7 @@
   case K_PRIVATE:   W = R;                       break;
   case K_PROTECTED: W = LocalizeProtected(d, R); break;
   case K_PUBLIC:    W = LocalizePublic(d, R);    break;
+  default: abort();
   }
 
   if (W->h_tid & GCFLAG_WRITE_BARRIER)
diff --git a/c3/nursery.c b/c3/nursery.c
--- a/c3/nursery.c
+++ b/c3/nursery.c
@@ -17,6 +17,7 @@
 
 enum protection_class_t stmgc_classify(struct tx_descriptor *d, gcptr obj)
 {
+    /* note that this function never returns K_OLD_PRIVATE. */
     if (obj->h_revision == stm_local_revision)
         return K_PRIVATE;
     if (stmgc_is_young(d, obj))
@@ -25,8 +26,6 @@
         return K_PUBLIC;
 }
 
-#define K_OLD_PRIVATE  7
-
 static enum protection_class_t dclassify(gcptr obj)
 {
     /* for assertions only; moreover this function returns K_PRIVATE
@@ -753,6 +752,7 @@
 
 int stmgc_nursery_hiding(int hide)
 {
+#ifdef _GC_DEBUG
     struct tx_descriptor *d = thread_descriptor;
 
     if (hide) {
@@ -779,7 +779,7 @@
         }
 
     } G2L_LOOP_END;
-
+#endif
     return 1;
 }
 
diff --git a/c3/nursery.h b/c3/nursery.h
--- a/c3/nursery.h
+++ b/c3/nursery.h
@@ -29,7 +29,8 @@
 
 struct tx_descriptor;  /* from et.h */
 
-enum protection_class_t { K_PRIVATE, K_PROTECTED, K_PUBLIC };
+enum protection_class_t { K_PRIVATE, K_PROTECTED, K_PUBLIC,
+                          K_OLD_PRIVATE  /* <-only for dclassify() */ };
 
 gcptr stmgc_duplicate(gcptr, revision_t);
 void stmgc_start_transaction(struct tx_descriptor *);
diff --git a/c3/stmsync.c b/c3/stmsync.c
--- a/c3/stmsync.c
+++ b/c3/stmsync.c
@@ -110,9 +110,7 @@
 
 /************************************************************/
 
-/* sync_required is either 0 or (unsigned)-1 */
-#define SYNC_REQUIRED  ((unsigned long)-1)
-static unsigned long sync_required = 0;
+static revision_t sync_required = 0;
 
 void stm_perform_transaction(gcptr arg, int (*callback)(gcptr, int))
 {   /* must save roots around this call */
@@ -267,7 +265,7 @@
        which prevents any other thread from running in a transaction.
        Warning, may block waiting for rwlock_in_transaction while another
        thread runs a major GC itself! */
-    ACCESS_ONCE(sync_required) = SYNC_REQUIRED;
+    ACCESS_ONCE(sync_required) = 1;
     stm_stop_sharedlock();
     start_exclusivelock();
     ACCESS_ONCE(sync_required) = 0;


More information about the pypy-commit mailing list