[pypy-commit] pypy rgc-mem-pressure: better estimate for size of W_Hash's mallocs

justinpeel noreply at buildbot.pypy.org
Mon Oct 17 22:17:03 CEST 2011


Author: Justin Peel <notmuchtotell at gmail.com>
Branch: rgc-mem-pressure
Changeset: r48159:46f5717326d9
Date: 2011-10-17 14:16 -0600
http://bitbucket.org/pypy/pypy/changeset/46f5717326d9/

Log:	better estimate for size of W_Hash's mallocs

diff --git a/pypy/module/_hashlib/interp_hashlib.py b/pypy/module/_hashlib/interp_hashlib.py
--- a/pypy/module/_hashlib/interp_hashlib.py
+++ b/pypy/module/_hashlib/interp_hashlib.py
@@ -12,10 +12,12 @@
 
 algorithms = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512')
 
-# HASH_MALLOC_SIZE is the size of EVP_MD, EVP_MD_CTX plus their points.
-# Used for adding memory pressure.
+# HASH_MALLOC_SIZE is the size of EVP_MD, EVP_MD_CTX plus their points
+# Used for adding memory pressure. Last number is an (under?)estimate of
+# EVP_PKEY_CTX's size.
+# XXX: Make a better estimate here
 HASH_MALLOC_SIZE = ropenssl.EVP_MD_SIZE + ropenssl.EVP_MD_CTX_SIZE \
-        + rffi.sizeof(ropenssl.EVP_MD) * 2
+        + rffi.sizeof(ropenssl.EVP_MD) * 2 + 208
 
 class W_Hash(Wrappable):
     ctx = lltype.nullptr(ropenssl.EVP_MD_CTX.TO)


More information about the pypy-commit mailing list