[Python-checkins] CVS: python/dist/src/Include objimpl.h,2.39,2.40

Tim Peters tim_one@users.sourceforge.net
Sat, 06 Oct 2001 12:04:03 -0700


Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv24971/python/Include

Modified Files:
	objimpl.h 
Log Message:
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>.


Index: objimpl.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/objimpl.h,v
retrieving revision 2.39
retrieving revision 2.40
diff -C2 -d -r2.39 -r2.40
*** objimpl.h	2001/10/02 21:24:57	2.39
--- objimpl.h	2001/10/06 19:04:00	2.40
***************
*** 231,235 ****
  	((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(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, int);
  
--- 231,236 ----
  	((o)->ob_type->tp_is_gc == NULL || (o)->ob_type->tp_is_gc(o)))
  
! extern DL_IMPORT(PyObject *) _PyObject_GC_Malloc(PyTypeObject *,
! 					int nitems, size_t padding);
  extern DL_IMPORT(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, int);