[pypy-commit] pypy raw-memory-pressure-nursery: fix hashlib module

fijal noreply at buildbot.pypy.org
Wed Feb 15 08:31:47 CET 2012


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: raw-memory-pressure-nursery
Changeset: r52496:27bcc2c71f0c
Date: 2012-02-15 09:31 +0200
http://bitbucket.org/pypy/pypy/changeset/27bcc2c71f0c/

Log:	fix hashlib module

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
@@ -23,10 +23,10 @@
     ctx = lltype.nullptr(ropenssl.EVP_MD_CTX.TO)
 
     def __init__(self, space, name):
+        digest_type = self.digest_type_by_name(space)
+        self.digest_size = rffi.getintfield(digest_type, 'c_md_size')
         rgc.add_memory_pressure(self, HASH_MALLOC_SIZE + self.digest_size)
         self.name = name
-        digest_type = self.digest_type_by_name(space)
-        self.digest_size = rffi.getintfield(digest_type, 'c_md_size')
 
         # Allocate a lock for each HASH object.
         # An optimization would be to not release the GIL on small requests,


More information about the pypy-commit mailing list