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

arigo at codespeak.net arigo at codespeak.net
Sat Nov 18 20:59:14 CET 2006


Author: arigo
Date: Sat Nov 18 20:59:12 2006
New Revision: 34748

Modified:
   pypy/dist/pypy/translator/c/src/obmalloc.c
Log:
Minor hacks at obmalloc.c to make its debugging malloc'er independent of
the rest of Python too.



Modified: pypy/dist/pypy/translator/c/src/obmalloc.c
==============================================================================
--- pypy/dist/pypy/translator/c/src/obmalloc.c	(original)
+++ pypy/dist/pypy/translator/c/src/obmalloc.c	Sat Nov 18 20:59:12 2006
@@ -430,7 +430,7 @@
 	if (bp == NULL)
 		return NULL;
 
-#ifdef PYMALLOC_DEBUG
+#if 0   /* XXX removed for PyPy - #ifdef PYMALLOC_DEBUG */
 	if (Py_GETENV("PYTHONMALLOCSTATS"))
 		_PyObject_DebugMallocStats();
 #endif
@@ -894,6 +894,16 @@
  * it wraps a real allocator, adding extra debugging info to the memory blocks.
  */
 
+/* XXX added for PyPy for stand-alone usage */
+void Py_FatalError(const char *msg)
+{
+  fprintf(stderr, "Py_FatalError() called in obmalloc!\n%s\n", msg);
+  exit(1);
+}
+#define PyOS_snprintf snprintf
+/* end of XXX */
+
+
 /* Special bytes broadcast into debug memory blocks at appropriate times.
  * Strings of these are unlikely to be valid addresses, floats, ints or
  * 7-bit ASCII.



More information about the Pypy-commit mailing list