[pypy-commit] pypy default: Merge in zlib-mem-pressure. It probably needs more memory pressure, but this is better than none.

justinpeel noreply at buildbot.pypy.org
Thu Mar 15 04:24:07 CET 2012


Author: Justin Peel <notmuchtotell at gmail.com>
Branch: 
Changeset: r53656:fb2a05e148e3
Date: 2012-03-14 21:21 -0600
http://bitbucket.org/pypy/pypy/changeset/fb2a05e148e3/

Log:	Merge in zlib-mem-pressure. It probably needs more memory pressure,
	but this is better than none.

diff --git a/pypy/rlib/rzlib.py b/pypy/rlib/rzlib.py
--- a/pypy/rlib/rzlib.py
+++ b/pypy/rlib/rzlib.py
@@ -1,6 +1,7 @@
 from __future__ import with_statement
 import sys
 
+from pypy.rlib import rgc
 from pypy.rlib.rstring import StringBuilder
 from pypy.rpython.lltypesystem import rffi, lltype
 from pypy.rpython.tool import rffi_platform
@@ -236,6 +237,7 @@
     compress data.
     """
     stream = lltype.malloc(z_stream, flavor='raw', zero=True)
+    rgc.add_memory_pressure(rffi.sizeof(z_stream))
     err = _deflateInit2(stream, level, method, wbits, memLevel, strategy)
     if err == Z_OK:
         return stream
@@ -264,6 +266,7 @@
     decompress data.
     """
     stream = lltype.malloc(z_stream, flavor='raw', zero=True)
+    rgc.add_memory_pressure(rffi.sizeof(z_stream))
     err = _inflateInit2(stream, wbits)
     if err == Z_OK:
         return stream


More information about the pypy-commit mailing list