Commits

Justin Peel committed eac6257

improve a test for rgc.add_memory_pressure. not sure that it is really doing what we want it to do.

  • Participants
  • Parent commits 1376c28
  • Branches rgc-mem-pressure

Comments (0)

Files changed (1)

File pypy/translator/c/test/test_newgc.py

         assert res == -99997
 
     def define_nongc_opaque_attached_to_gc(cls):
+        from pypy.module._hashlib.interp_hashlib import HASH_MALLOC_SIZE
+        from pypy.rlib import rgc, ropenssl
         from pypy.rpython.lltypesystem import rffi
-        from pypy.rlib import ropenssl
+
         class A:
             def __init__(self):
                 self.ctx = lltype.malloc(ropenssl.EVP_MD_CTX.TO,
                     flavor='raw')
                 digest = ropenssl.EVP_get_digestbyname('sha1')
                 ropenssl.EVP_DigestInit(self.ctx, digest)
+                rgc.add_memory_pressure(HASH_MALLOC_SIZE + 64)
+
             def __del__(self):
                 ropenssl.EVP_MD_CTX_cleanup(self.ctx)
                 lltype.free(self.ctx, flavor='raw')