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

oscar at codespeak.net oscar at codespeak.net
Thu Oct 25 17:01:31 CEST 2007


Author: oscar
Date: Thu Oct 25 17:01:31 2007
New Revision: 47944

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

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:01:31 2007
@@ -196,9 +196,11 @@
 _FLOAT_OFFSET = 40
 FLOAT_ADD = 41
 FLOAT_SUBTRACT = 42
+# NB: 43 ... 48 are implemented above
 FLOAT_MULTIPLY = 49
 FLOAT_DIVIDE = 50
 FLOAT_TRUNCATED = 51
+# OPTIONAL: 52, 53
 FLOAT_TIMES_TWO_POWER = 54
 FLOAT_SQUARE_ROOT = 55
 FLOAT_SIN = 56
@@ -506,6 +508,16 @@
     return 
 
 # ___________________________________________________________________________
+# Squeak Miscellaneous Primitives (128-149)
+FULL_GC = 130
+
+ at primitive(FULL_GC)
+ at stack(1) # Squeak pops the arg and ignores it ... go figure
+def func(args, (w_arg,)):
+    from pypy.rlib import rgc
+    rgc.collect()
+
+# ___________________________________________________________________________
 # Boolean Primitives
 
 LESSTHAN = 3

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:01:31 2007
@@ -328,3 +328,8 @@
     assert equals_ttp(-1,2,-4)
     assert equals_ttp(1.5,0,1.5)
     assert equals_ttp(1.5,-1,0.75)
+
+def test_full_gc():
+    # Should not fail :-)
+    prim(p.FULL_GC, [42]) # Dummy arg
+



More information about the Pypy-commit mailing list