[pypy-svn] r24066 - pypy/dist/pypy/translator/c/src

mwh at codespeak.net mwh at codespeak.net
Tue Mar 7 14:35:18 CET 2006


Author: mwh
Date: Tue Mar  7 14:35:17 2006
New Revision: 24066

Modified:
   pypy/dist/pypy/translator/c/src/address.h
Log:
have raw_malloc use calloc to get zeroed memory, so in particular 
internal pointers in gcstructs start out life as NULL...

argh, this wasted half a day.


Modified: pypy/dist/pypy/translator/c/src/address.h
==============================================================================
--- pypy/dist/pypy/translator/c/src/address.h	(original)
+++ pypy/dist/pypy/translator/c/src/address.h	Tue Mar  7 14:35:17 2006
@@ -17,7 +17,7 @@
 #define OP_ADR_GE(x,y,r,err)	  r = ((x) >= (y))
 
 #define OP_RAW_MALLOC(size,r,err)                                           \
-    r = (void*) malloc(size);                                              \
+    r = (void*) calloc(1, size);                                            \
     if (r == NULL) FAIL_EXCEPTION(err, PyExc_MemoryError, "out of memory");\
 
 #ifdef MS_WINDOWS



More information about the Pypy-commit mailing list