Author: Devin Jeanpierre <[email protected]>
Branch: incminimark-ll_assert
Changeset: r85017:103f0b255b8d
Date: 2016-06-07 14:22 -0700
http://bitbucket.org/pypy/pypy/changeset/103f0b255b8d/

Log:    Add assertions for an initialized nursery.

        This should make it easier to debug if you accidentally allocate
        during GC.

diff --git a/rpython/memory/gc/incminimark.py b/rpython/memory/gc/incminimark.py
--- a/rpython/memory/gc/incminimark.py
+++ b/rpython/memory/gc/incminimark.py
@@ -643,6 +643,8 @@
             #
             # Get the memory from the nursery.  If there is not enough space
             # there, do a collect first.
+            ll_assert(self.nursery_free != llmemory.NULL,
+                      "uninitialized nursery")
             result = self.nursery_free
             self.nursery_free = new_free = result + totalsize
             if new_free > self.nursery_top:
@@ -702,6 +704,8 @@
             #
             # Get the memory from the nursery.  If there is not enough space
             # there, do a collect first.
+            ll_assert(self.nursery_free != llmemory.NULL,
+                      "uninitialized nursery")
             result = self.nursery_free
             self.nursery_free = new_free = result + totalsize
             if new_free > self.nursery_top:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to