Author: Justin Peel <notmuchtot...@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)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to