[pypy-commit] pypy rgc-mem-pressure: add memory pressure entry

justinpeel noreply at buildbot.pypy.org
Mon Oct 17 04:52:47 CEST 2011


Author: Justin Peel <notmuchtotell at gmail.com>
Branch: rgc-mem-pressure
Changeset: r48108:ac989ce70d94
Date: 2011-10-16 20:52 -0600
http://bitbucket.org/pypy/pypy/changeset/ac989ce70d94/

Log:	add memory pressure entry

diff --git a/pypy/rlib/rgc.py b/pypy/rlib/rgc.py
--- a/pypy/rlib/rgc.py
+++ b/pypy/rlib/rgc.py
@@ -259,6 +259,20 @@
     """Add memory pressure for OpaquePtrs."""
     pass
 
+class AddMemoryPressureEntry(ExtRegistryEntry):
+    _about_ = add_memory_pressure
+
+    def compute_result_annotation(self, s_nbytes):
+        from pypy.annotation import model as annmodel
+        return annmodel.s_None
+
+    def specialize_call(self, hop):
+        [v_size] = hop.inputargs(lltype.Signed)
+        hop.exception_cannot_occur()
+        return hop.genop('gc_add_memory_pressure', [v_size],
+                         resulttype=lltype.Void)
+
+
 def get_rpy_memory_usage(gcref):
     "NOT_RPYTHON"
     # approximate implementation using CPython's type info


More information about the pypy-commit mailing list