diff Include/objimpl.h @ 20293:b285decf0421 legacy-trunk

Repaired the debug Windows deaths in test_descr, by allocating enough pad memory to properly align the __dict__ pointer in all cases. gcmodule.c/objimpl.h, _PyObject_GC_Malloc: + Added a "padding" argument so that this flavor of malloc can allocate enough bytes for alignment padding (it can't know this is needed, but its callers do). typeobject.c, PyType_GenericAlloc: + Allocated enough bytes to align the __dict__ pointer. + Sped and simplified the round-up-to-PTRSIZE logic. + Added blank lines so I could parse the if/else blocks <0.7 wink>.
author Tim Peters <tim.peters@gmail.com>
date Sat, 06 Oct 2001 19:04:01 +0000
parents 0b99174d6b17
children 426b379a138b
line wrap: on
line diff
--- a/Include/objimpl.h	Sat Oct 06 17:45:17 2001 +0000
+++ b/Include/objimpl.h	Sat Oct 06 19:04:01 2001 +0000
@@ -230,7 +230,8 @@
 #define PyObject_IS_GC(o) (PyType_IS_GC((o)->ob_type) && \
 	((o)->ob_type->tp_is_gc == NULL || (o)->ob_type->tp_is_gc(o)))
 
-extern DL_IMPORT(PyObject *) _PyObject_GC_Malloc(PyTypeObject *, int);
+extern DL_IMPORT(PyObject *) _PyObject_GC_Malloc(PyTypeObject *,
+					int nitems, size_t padding);
 extern DL_IMPORT(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, int);
 
 #define PyObject_GC_Resize(type, op, n) \