[pypy-commit] pypy default: Fix a veeeery slow leak.

arigo noreply at buildbot.pypy.org
Wed Jul 20 18:51:28 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r45780:27f5477fcaa7
Date: 2011-07-20 18:51 +0200
http://bitbucket.org/pypy/pypy/changeset/27f5477fcaa7/

Log:	Fix a veeeery slow leak.

diff --git a/pypy/rpython/memory/gctransform/asmgcroot.py b/pypy/rpython/memory/gctransform/asmgcroot.py
--- a/pypy/rpython/memory/gctransform/asmgcroot.py
+++ b/pypy/rpython/memory/gctransform/asmgcroot.py
@@ -184,7 +184,9 @@
             # old NULL entries
             gcdata.dead_threads_count += 1
             if (gcdata.dead_threads_count & 511) == 0:
-                gcdata.aid2stack = copy_without_null_values(gcdata.aid2stack)
+                copy = copy_without_null_values(gcdata.aid2stack)
+                gcdata.aid2stack.delete()
+                gcdata.aid2stack = copy
 
         def belongs_to_current_thread(framedata):
             # xxx obscure: the answer is Yes if, as a pointer, framedata
diff --git a/pypy/rpython/memory/gctransform/framework.py b/pypy/rpython/memory/gctransform/framework.py
--- a/pypy/rpython/memory/gctransform/framework.py
+++ b/pypy/rpython/memory/gctransform/framework.py
@@ -1449,8 +1449,9 @@
             # old NULL entries
             gcdata.dead_threads_count += 1
             if (gcdata.dead_threads_count & 511) == 0:
-                gcdata.thread_stacks = copy_without_null_values(
-                    gcdata.thread_stacks)
+                copy = copy_without_null_values(gcdata.thread_stacks)
+                gcdata.thread_stacks.delete()
+                gcdata.thread_stacks = copy
 
         def switch_shadow_stacks(new_aid):
             save_away_current_stack()


More information about the pypy-commit mailing list