[pypy-svn] r16108 - in pypy/dist/pypy/translator/llvm2: module test

ericvrp at codespeak.net ericvrp at codespeak.net
Wed Aug 17 13:24:08 CEST 2005


Author: ericvrp
Date: Wed Aug 17 13:24:07 2005
New Revision: 16108

Modified:
   pypy/dist/pypy/translator/llvm2/module/extfunction.py
   pypy/dist/pypy/translator/llvm2/test/test_extfunc.py
Log:
* fixed typos in test/extfunc.py
* removed overalocate in malloc, we did that in to places now


Modified: pypy/dist/pypy/translator/llvm2/module/extfunction.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/module/extfunction.py	(original)
+++ pypy/dist/pypy/translator/llvm2/module/extfunction.py	Wed Aug 17 13:24:07 2005
@@ -14,16 +14,14 @@
 declare ccc sbyte* %memset(sbyte*, int, uint)
 
 internal fastcc sbyte* %gc_malloc(uint %n) {
-    %nn = add uint %n, 1
-    %ptr = call ccc sbyte* %GC_malloc(uint %nn)
-    call ccc sbyte* %memset(sbyte* %ptr, int 0, uint %nn)    ;XXX force non-zero init for testing
+    %ptr = call ccc sbyte* %GC_malloc(uint %n)
+    call ccc sbyte* %memset(sbyte* %ptr, int 0, uint %n)
     ret sbyte* %ptr
 }
 
 internal fastcc sbyte* %gc_malloc_atomic(uint %n) {
-    %nn = add uint %n, 1
-    %ptr = call ccc sbyte* %GC_malloc_atomic(uint %nn)
-    call ccc sbyte* %memset(sbyte* %ptr, int 0, uint %nn)    ;XXX force non-zero init for testing
+    %ptr = call ccc sbyte* %GC_malloc_atomic(uint %n)
+    call ccc sbyte* %memset(sbyte* %ptr, int 0, uint %n)
     ret sbyte* %ptr
 }
 """

Modified: pypy/dist/pypy/translator/llvm2/test/test_extfunc.py
==============================================================================
--- pypy/dist/pypy/translator/llvm2/test/test_extfunc.py	(original)
+++ pypy/dist/pypy/translator/llvm2/test/test_extfunc.py	Wed Aug 17 13:24:07 2005
@@ -6,6 +6,7 @@
 
 from pypy.tool.udir import udir
 from pypy.translator.llvm2.genllvm import compile_function
+from pypy.rpython.rarithmetic import r_uint
 
 py.log.setconsumer("genllvm", py.log.STDOUT)
 py.log.setconsumer("genllvm database prepare", None)
@@ -198,7 +199,7 @@
     def fn(l):
         filename = tmpfile[:l]
         return os.path.exists(filename)
-    f = compile_function(fn, [r_uint], view=True)
+    f = compile_function(fn, [r_uint])
     open(tmpfile, 'w').close()
     lfile = len(tmpfile)
     assert f(lfile) == True



More information about the Pypy-commit mailing list