[Patches] [Patch #101699] GC fixes for malloc() == NULL

noreply@sourceforge.net noreply@sourceforge.net
Thu, 28 Sep 2000 16:38:03 -0700


Patch #101699 has been updated. 

Project: 
Category: core (C code)
Status: Open
Summary: GC fixes for malloc() == NULL

Follow-Ups:

Date: 2000-Sep-28 16:38
By: nascheme

Comment:
I would like some comments on this patch before I apply it.  First,
there must be a matching PyObject_GC_Fini() for every
PyObject_GC_Init().  Second of all, between the Init and Fini calls, all
pointers in the object struct followed by tp_recurse must be valid.  GC
can be triggered at wierd times.

The problem with classobject.c was that if PyDict_New() failed,
PyObject_DEL() was used to free the instance (which does not call
PyObject_GC_Fini()).

The problem with cPickle.c was that if PyDict_New() failed, Py_DECREF()
was called to free the instance.  Py_DECREF() will call
instance_dealloc() which calls PyObject_GC_Fini().

-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=101699&group_id=5470