[pypy-commit] pypy improve-vmprof-testing: fight fight until we win

fijal pypy.commits at gmail.com
Fri Aug 5 11:55:16 EDT 2016


Author: fijal
Branch: improve-vmprof-testing
Changeset: r86037:0bcafba73720
Date: 2016-08-05 17:54 +0200
http://bitbucket.org/pypy/pypy/changeset/0bcafba73720/

Log:	fight fight until we win

diff --git a/rpython/rlib/rvmprof/rvmprof.py b/rpython/rlib/rvmprof/rvmprof.py
--- a/rpython/rlib/rvmprof/rvmprof.py
+++ b/rpython/rlib/rvmprof/rvmprof.py
@@ -25,6 +25,10 @@
     def __str__(self):
         return self.msg
 
+class FakeWeakCodeObjectList(object):
+    def add_handle(self, handle):
+        pass
+
 class VMProf(object):
 
     _immutable_fields_ = ['is_enabled?']
@@ -90,6 +94,8 @@
                 self.initialize()
         if self.use_weaklist:
             CodeClass._vmprof_weak_list = WeakCodeObjectList()
+        else:
+            CodeClass._vmprof_weak_list = FakeWeakCodeObjectList()
         #
         def gather_all_code_objs():
             all_code_wrefs = CodeClass._vmprof_weak_list.get_all_handles()


More information about the pypy-commit mailing list