[pypy-svn] r31562 - in pypy/branch/no-zeroing-assumption/pypy: rpython/lltypesystem translator/c
mwh at codespeak.net
mwh at codespeak.net
Wed Aug 23 18:01:27 CEST 2006
Author: mwh
Date: Wed Aug 23 18:01:25 2006
New Revision: 31562
Modified:
pypy/branch/no-zeroing-assumption/pypy/rpython/lltypesystem/lltype.py
pypy/branch/no-zeroing-assumption/pypy/translator/c/funcgen.py
Log:
couple of small hacks to get _most_ of the c tests running
(they still zero memory though)
Modified: pypy/branch/no-zeroing-assumption/pypy/rpython/lltypesystem/lltype.py
==============================================================================
--- pypy/branch/no-zeroing-assumption/pypy/rpython/lltypesystem/lltype.py (original)
+++ pypy/branch/no-zeroing-assumption/pypy/rpython/lltypesystem/lltype.py Wed Aug 23 18:01:25 2006
@@ -1526,9 +1526,9 @@
def malloc(T, n=None, flavor='gc', immortal=False, extra_args=(), zero=False):
if isinstance(T, Struct):
- o = _struct(T, n, example=zero)
+ o = _struct(T, n, example=zero or immortal)
elif isinstance(T, Array):
- o = _array(T, n, example=zero)
+ o = _array(T, n, example=zero or immortal)
else:
raise TypeError, "malloc for Structs and Arrays only"
if T._gckind != 'gc' and not immortal and flavor.startswith('gc'):
Modified: pypy/branch/no-zeroing-assumption/pypy/translator/c/funcgen.py
==============================================================================
--- pypy/branch/no-zeroing-assumption/pypy/translator/c/funcgen.py (original)
+++ pypy/branch/no-zeroing-assumption/pypy/translator/c/funcgen.py Wed Aug 23 18:01:25 2006
@@ -508,6 +508,8 @@
return self.gcpolicy.zero_malloc(TYPE, esize, eresult)
+ OP_ZERO_MALLOC = OP_MALLOC
+
def OP_MALLOC_VARSIZE(self, op):
TYPE = self.lltypemap(op.result).TO
typename = self.db.gettype(TYPE)
@@ -546,6 +548,8 @@
result += '\n}'
return result
+ OP_ZERO_MALLOC_VARSIZE = OP_MALLOC_VARSIZE
+
def OP_RAW_MALLOC(self, op):
eresult = self.expr(op.result)
esize = self.expr(op.args[0])
More information about the Pypy-commit
mailing list