[pypy-svn] r69111 - in pypy/branch/gc-dump-heap/pypy/module/gc: . test
fijal at codespeak.net
fijal at codespeak.net
Tue Nov 10 13:31:43 CET 2009
Author: fijal
Date: Tue Nov 10 13:31:42 2009
New Revision: 69111
Modified:
pypy/branch/gc-dump-heap/pypy/module/gc/__init__.py
pypy/branch/gc-dump-heap/pypy/module/gc/interp_gc.py
pypy/branch/gc-dump-heap/pypy/module/gc/test/test_gc.py
Log:
Rename operation here as well (missing commit)
Modified: pypy/branch/gc-dump-heap/pypy/module/gc/__init__.py
==============================================================================
--- pypy/branch/gc-dump-heap/pypy/module/gc/__init__.py (original)
+++ pypy/branch/gc-dump-heap/pypy/module/gc/__init__.py Tue Nov 10 13:31:42 2009
@@ -12,5 +12,5 @@
'disable_finalizers': 'interp_gc.disable_finalizers',
'estimate_heap_size': 'interp_gc.estimate_heap_size',
'garbage' : 'space.newlist([])',
- 'dump_heap': 'interp_gc.dump_heap',
+ 'dump_heap_stats': 'interp_gc.dump_heap_stats',
}
Modified: pypy/branch/gc-dump-heap/pypy/module/gc/interp_gc.py
==============================================================================
--- pypy/branch/gc-dump-heap/pypy/module/gc/interp_gc.py (original)
+++ pypy/branch/gc-dump-heap/pypy/module/gc/interp_gc.py Tue Nov 10 13:31:42 2009
@@ -54,12 +54,14 @@
space.wrap("can't estimate the heap size"))
estimate_heap_size.unwrap_spec = [ObjSpace]
-def dump_heap(space, filename):
- tb = rgc._dump_heap()
+def dump_heap_stats(space, filename):
+ tb = rgc._heap_stats()
+ if not tb:
+ raise OperationError(space.w_RuntimeError,
+ space.wrap("Wrong GC"))
f = open_file_as_stream(filename, mode="w")
for i in range(len(tb)):
f.write("%d %d " % (tb[i].count, tb[i].size))
f.write(",".join([str(tb[i].links[j]) for j in range(len(tb))]) + "\n")
f.close()
-
-dump_heap.unwrap_spec = [ObjSpace, str]
+dump_heap_stats.unwrap_spec = [ObjSpace, str]
Modified: pypy/branch/gc-dump-heap/pypy/module/gc/test/test_gc.py
==============================================================================
--- pypy/branch/gc-dump-heap/pypy/module/gc/test/test_gc.py (original)
+++ pypy/branch/gc-dump-heap/pypy/module/gc/test/test_gc.py Tue Nov 10 13:31:42 2009
@@ -85,11 +85,11 @@
self.size = size
self.links = links
- def fake_dump_heap():
+ def fake_heap_stats():
return [X(1, 12, [0, 0]), X(2, 10, [10, 0])]
- cls._dump_heap = rgc._dump_heap
- rgc._dump_heap = fake_dump_heap
+ cls._heap_stats = rgc._heap_stats
+ rgc._heap_stats = fake_heap_stats
fname = udir.join('gcdump.log')
cls.space = gettestobjspace()
cls.w_fname = cls.space.wrap(str(fname))
@@ -99,10 +99,10 @@
import py
from pypy.rlib import rgc
- rgc._dump_heap = cls._dump_heap
+ rgc._heap_stats = cls._heap_stats
assert py.path.local(cls._fname).read() == '1 12 0,0\n2 10 10,0\n'
- def test_gc_dump_heap(self):
+ def test_gc_heap_stats(self):
import gc
- gc.dump_heap(self.fname)
+ gc.dump_heap_stats(self.fname)
More information about the Pypy-commit
mailing list