[pypy-commit] pypy rgc-mem-pressure: fix gc framework code

justinpeel noreply at buildbot.pypy.org
Fri Oct 7 23:10:42 CEST 2011


Author: Justin Peel <notmuchtotell at gmail.com>
Branch: rgc-mem-pressure
Changeset: r47869:04ba9860f69c
Date: 2011-10-07 15:10 -0600
http://bitbucket.org/pypy/pypy/changeset/04ba9860f69c/

Log:	fix gc framework code

diff --git a/pypy/rpython/memory/gctransform/framework.py b/pypy/rpython/memory/gctransform/framework.py
--- a/pypy/rpython/memory/gctransform/framework.py
+++ b/pypy/rpython/memory/gctransform/framework.py
@@ -374,24 +374,23 @@
             self.malloc_varsize_nonmovable_ptr = None
 
         if getattr(GCClass, 'raw_malloc_memory_pressure', False):
-            def raw_malloc_memory_pressure(length, itemsize):
+            def raw_malloc_memory_pressure_varsize(length, itemsize):
                 totalmem = length * itemsize
                 if totalmem > 0:
                     gcdata.gc.raw_malloc_memory_pressure(totalmem)
                 #else: probably an overflow -- the following rawmalloc
                 #      will fail then
-            self.raw_malloc_memory_pressure_ptr = getfn(
-                raw_malloc_memory_pressure,
+            def raw_malloc_memory_pressure(sizehint):
+                gcdata.gc.raw_malloc_memory_pressure(sizehint)
+            self.raw_malloc_memory_pressure_varsize_ptr = getfn(
+                raw_malloc_memory_pressure_varsize,
                 [annmodel.SomeInteger(), annmodel.SomeInteger()],
                 annmodel.s_None, minimal_transform = False)
+            self.raw_malloc_memory_pressure = getfn(
+                raw_malloc_memory_pressure,
+                [annmodel.SomeInteger()],
+                annmode.s_None, minimal_transform = False)
 
-        if getattr(GCClass, 'add_memory_pressure', False):
-            def add_memory_pressure(size):
-                gcdata.gc.raw_malloc_memory_pressure(size)
-            self.add_memory_pressure_ptr = getfun(
-                add_memory_pressure,
-                [annmodel.SomeInteger()],
-                annmodel.s_None, minimal_transform = False)
 
         self.identityhash_ptr = getfn(GCClass.identityhash.im_func,
                                       [s_gc, s_gcref],


More information about the pypy-commit mailing list