Author: Armin Rigo <[email protected]>
Branch: stm-gc-2
Changeset: r63124:873d69a15bc6
Date: 2013-04-08 10:44 +0200
http://bitbucket.org/pypy/pypy/changeset/873d69a15bc6/

Log:    Don't call rgc.add_memory_pressure() from allocate_ll_lock(), which
        I want to use from the GC itself.

diff --git a/rpython/rlib/rthread.py b/rpython/rlib/rthread.py
--- a/rpython/rlib/rthread.py
+++ b/rpython/rlib/rthread.py
@@ -90,6 +90,9 @@
                               _nowrapper=True)
 
 def allocate_lock():
+    # Add some memory pressure for the size of the lock because it is an
+    # Opaque object
+    rgc.add_memory_pressure(TLOCKP_SIZE)
     return Lock(allocate_ll_lock())
 
 @specialize.arg(0)
@@ -184,9 +187,6 @@
     if rffi.cast(lltype.Signed, res) <= 0:
         lltype.free(ll_lock, flavor='raw', track_allocation=False)
         raise error("out of resources")
-    # Add some memory pressure for the size of the lock because it is an
-    # Opaque object
-    rgc.add_memory_pressure(TLOCKP_SIZE)
     return ll_lock
 
 def free_ll_lock(ll_lock):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to