[pypy-svn] r47945 - in pypy/dist/pypy/lang/smalltalk: . test

oscar at codespeak.net oscar at codespeak.net
Thu Oct 25 17:05:40 CEST 2007


Author: oscar
Date: Thu Oct 25 17:05:40 2007
New Revision: 47945

Modified:
   pypy/dist/pypy/lang/smalltalk/primitives.py
   pypy/dist/pypy/lang/smalltalk/test/test_primitives.py
Log:
(cfbolz, oscar) incremental gc (faked)

Modified: pypy/dist/pypy/lang/smalltalk/primitives.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/primitives.py	(original)
+++ pypy/dist/pypy/lang/smalltalk/primitives.py	Thu Oct 25 17:05:40 2007
@@ -510,12 +510,18 @@
 # ___________________________________________________________________________
 # Squeak Miscellaneous Primitives (128-149)
 FULL_GC = 130
+INC_GC = 131
 
+def fake_bytes_left():
+    return 2**20 # XXX we don't know how to do this :-(
+
+ at primitive(INC_GC) # XXX the same for now
 @primitive(FULL_GC)
 @stack(1) # Squeak pops the arg and ignores it ... go figure
 def func(args, (w_arg,)):
     from pypy.rlib import rgc
     rgc.collect()
+    return fake_bytes_left()
 
 # ___________________________________________________________________________
 # Boolean Primitives

Modified: pypy/dist/pypy/lang/smalltalk/test/test_primitives.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/test/test_primitives.py	(original)
+++ pypy/dist/pypy/lang/smalltalk/test/test_primitives.py	Thu Oct 25 17:05:40 2007
@@ -329,6 +329,10 @@
     assert equals_ttp(1.5,0,1.5)
     assert equals_ttp(1.5,-1,0.75)
 
+def test_inc_gc():
+    # Should not fail :-)
+    prim(p.INC_GC, [42]) # Dummy arg
+
 def test_full_gc():
     # Should not fail :-)
     prim(p.FULL_GC, [42]) # Dummy arg



More information about the Pypy-commit mailing list