aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2016-03-18 17:52:25 +0000
committerArmin Rigo <arigo@tunes.org>2016-03-18 17:52:25 +0000
commite868a862dba520db0e1ebaa010d79edccee1f9e9 (patch)
tree4d55c2ee95969724e4aefdcd6ed69c8702aa207c /pypy/module/cpyext/pyobject.py
parentmerge heads (diff)
downloadpypy-release-5.0.1.tar.gz
pypy-release-5.0.1.tar.bz2
pypy-release-5.0.1.zip
Add some "add_memory_pressure=True" at all places that malloc somethingrelease-5.0.1
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.
Diffstat (limited to 'pypy/module/cpyext/pyobject.py')
-rw-r--r--pypy/module/cpyext/pyobject.py3
1 files changed, 2 insertions, 1 deletions
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