[pypy-svn] r53996 - pypy/branch/io-improvements/pypy/rpython/memory/gc
arigo at codespeak.net
arigo at codespeak.net
Tue Apr 22 11:39:04 CEST 2008
Author: arigo
Date: Tue Apr 22 11:39:02 2008
New Revision: 53996
Modified:
pypy/branch/io-improvements/pypy/rpython/memory/gc/base.py
pypy/branch/io-improvements/pypy/rpython/memory/gc/marksweep.py
pypy/branch/io-improvements/pypy/rpython/memory/gc/semispace.py
Log:
Move the 'can_move' method in the base classes.
Modified: pypy/branch/io-improvements/pypy/rpython/memory/gc/base.py
==============================================================================
--- pypy/branch/io-improvements/pypy/rpython/memory/gc/base.py (original)
+++ pypy/branch/io-improvements/pypy/rpython/memory/gc/base.py Tue Apr 22 11:39:02 2008
@@ -105,6 +105,9 @@
def id(self, ptr):
return lltype.cast_ptr_to_int(ptr)
+ def can_move(self, addr):
+ return False
+
def set_max_heap_size(self, size):
pass
@@ -260,6 +263,9 @@
self.object_id_dict_ends_at = i + 1
return i + 1 # this produces id() values 1, 2, 3, 4...
+ def can_move(self, addr):
+ return True
+
def notify_objects_just_moved(self):
self.object_id_dict_ends_at = -1
Modified: pypy/branch/io-improvements/pypy/rpython/memory/gc/marksweep.py
==============================================================================
--- pypy/branch/io-improvements/pypy/rpython/memory/gc/marksweep.py (original)
+++ pypy/branch/io-improvements/pypy/rpython/memory/gc/marksweep.py Tue Apr 22 11:39:02 2008
@@ -38,6 +38,7 @@
POOLNODEPTR = lltype.Ptr(POOLNODE)
POOLNODE.become(lltype.Struct('gc_pool_node', ('linkedlist', HDRPTR),
('nextnode', POOLNODEPTR)))
+
def __init__(self, chunk_size=DEFAULT_CHUNK_SIZE, start_heap_size=4096):
self.heap_usage = 0 # at the end of the latest collection
self.bytes_malloced = 0 # since the latest collection
@@ -692,8 +693,6 @@
# reinstall the pool that was current at the beginning of x_clone()
clonedata.pool = self.x_swap_pool(curpool)
- def can_move(self, addr):
- return False
class PrintingMarkSweepGC(MarkSweepGC):
_alloc_flavor_ = "raw"
Modified: pypy/branch/io-improvements/pypy/rpython/memory/gc/semispace.py
==============================================================================
--- pypy/branch/io-improvements/pypy/rpython/memory/gc/semispace.py (original)
+++ pypy/branch/io-improvements/pypy/rpython/memory/gc/semispace.py Tue Apr 22 11:39:02 2008
@@ -537,8 +537,5 @@
finally:
self.finalizer_lock_count -= 1
- def can_move(self, addr):
- return True
-
STATISTICS_NUMBERS = 0
More information about the Pypy-commit
mailing list