From e868a862dba520db0e1ebaa010d79edccee1f9e9 Mon Sep 17 00:00:00 2001 From: Armin Rigo Date: Fri, 18 Mar 2016 17:52:25 +0000 Subject: Add some "add_memory_pressure=True" at all places that malloc something that is likely to be a PyObject or attached to a PyObject, and thus relying on our GC to know when it must be freed. This change helps a lot on some examples. --- pypy/module/cpyext/pyobject.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pypy/module/cpyext/pyobject.py') diff --git a/pypy/module/cpyext/pyobject.py b/pypy/module/cpyext/pyobject.py index 793bac0354..e4dba23f4e 100644 --- a/pypy/module/cpyext/pyobject.py +++ b/pypy/module/cpyext/pyobject.py @@ -50,7 +50,8 @@ class BaseCpyTypedescr(object): size += itemcount * pytype.c_tp_itemsize assert size >= rffi.sizeof(PyObject.TO) buf = lltype.malloc(rffi.VOIDP.TO, size, - flavor='raw', zero=True) + flavor='raw', zero=True, + add_memory_pressure=True) pyobj = rffi.cast(PyObject, buf) pyobj.c_ob_refcnt = 1 pyobj.c_ob_type = pytype -- cgit v1.2.3-65-gdbad