Author: Armin Rigo <ar...@tunes.org>
Branch: c7
Changeset: r614:5153d78a57ad
Date: 2014-01-16 17:38 +0100
http://bitbucket.org/pypy/stmgc/changeset/5153d78a57ad/

Log:    Add some asserts

diff --git a/c7/core.c b/c7/core.c
--- a/c7/core.c
+++ b/c7/core.c
@@ -237,8 +237,14 @@
                                                   SHARED_PAGE, REMAPPING_PAGE);
 #endif
     if (!was_shared) {
-        while (flag_page_private[pagenum] == REMAPPING_PAGE)
+        while (1) {
+            uint8_t state = ((uint8_t volatile *)flag_page_private)[pagenum];
+            if (state != REMAPPING_PAGE) {
+                assert(state == PRIVATE_PAGE);
+                break;
+            }
             spin_loop();
+        }
         return;
     }
 
@@ -371,6 +377,7 @@
 void _stm_write_slowpath(object_t *obj)
 {
     uintptr_t pagenum = ((uintptr_t)obj) / 4096;
+    assert(pagenum < NB_PAGES);
 
     /* old objects from the same transaction */
     if (flag_page_private[pagenum] == UNCOMMITTED_SHARED_PAGE
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to