[pypy-commit] pypy gc-incminimark-pinning: get rid of additional test classes
groggi
noreply at buildbot.pypy.org
Mon Jun 2 17:24:57 CEST 2014
Author: Gregor Wegberg <code at gregorwegberg.com>
Branch: gc-incminimark-pinning
Changeset: r71866:e8fea965f0cf
Date: 2014-05-30 18:50 +0200
http://bitbucket.org/pypy/pypy/changeset/e8fea965f0cf/
Log: get rid of additional test classes
diff --git a/rpython/memory/gc/test/test_object_pinning.py b/rpython/memory/gc/test/test_object_pinning.py
--- a/rpython/memory/gc/test/test_object_pinning.py
+++ b/rpython/memory/gc/test/test_object_pinning.py
@@ -213,15 +213,8 @@
# nursery should be full now, at least no space for another `S`. Next malloc should fail.
py.test.raises(Exception, self.malloc, S)
-
-class TestIncminimarkFewPinnedObjects(BaseDirectGCTest):
- from rpython.memory.gc.incminimark import IncrementalMiniMarkGC as GCClass
-
- GC_PARAMS = {'max_number_of_pinned_objects': 5
- }
-
def test_pinning_limit(self):
- for instance_nr in xrange(self.GC_PARAMS['max_number_of_pinned_objects']):
+ for instance_nr in xrange(self.gc.max_number_of_pinned_objects):
ptr = self.malloc(S)
adr = llmemory.cast_ptr_to_adr(ptr)
ptr.someInt = 100 + instance_nr
@@ -233,22 +226,13 @@
adr = llmemory.cast_ptr_to_adr(ptr)
self.stackroots.append(ptr)
assert not self.gc.pin(adr)
+ test_pinning_limit.GC_PARAMS = {'max_number_of_pinned_objects': 5}
-
-class TestIncminimarkManyPinnedObjects(BaseDirectGCTest):
- from rpython.memory.gc.incminimark import IncrementalMiniMarkGC as GCClass
-
- GC_PARAMS_PLENTY_PINNED_OBJECTS = {'max_number_of_pinned_objects': 50
- }
-
- def get_max_nursery_objects(self, TYPE):
- typeid = self.get_type_id(TYPE)
+ def test_full_pinned_nursery_pin_fail(self):
+ typeid = self.get_type_id(S)
size = self.gc.fixed_size(typeid) + self.gc.gcheaderbuilder.size_gc_header
raw_size = llmemory.raw_malloc_usage(size)
- return self.gc.nursery_size // raw_size
-
- def test_full_pinned_nursery_pin_fail(self):
- object_mallocs = self.get_max_nursery_objects(S)
+ object_mallocs = self.gc.nursery_size // raw_size
# just to be sure we do not run into the limit as we test not the limiter
# but rather the case of a nursery full with pinned objects.
assert object_mallocs < self.gc.max_number_of_pinned_objects
@@ -261,3 +245,4 @@
#
# nursery should be full now, at least no space for another `S`. Next malloc should fail.
py.test.raises(Exception, self.malloc, S)
+ test_full_pinned_nursery_pin_fail.GC_PARAMS = {'max_number_of_pinned_objects': 50}
More information about the pypy-commit
mailing list