[Python-checkins] CVS: python/dist/src/Objects classobject.c,2.123,2.124

Fred L. Drake fdrake@users.sourceforge.net
Thu, 22 Mar 2001 10:26:49 -0800


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

Modified Files:
	classobject.c 
Log Message:

A small change to the C API for weakly-referencable types:  Such types
must now initialize the extra field used by the weak-ref machinery to
NULL themselves, to avoid having to require PyObject_INIT() to check
if the type supports weak references and do it there.  This causes less
work to be done for all objects (the type object does not need to be
consulted to check for the Py_TPFLAGS_HAVE_WEAKREFS bit).


Index: classobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v
retrieving revision 2.123
retrieving revision 2.124
diff -C2 -r2.123 -r2.124
*** classobject.c	2001/02/26 18:56:37	2.123
--- classobject.c	2001/03/22 18:26:47	2.124
***************
*** 454,457 ****
--- 454,458 ----
  		return NULL;
  	}
+ 	inst->in_weakreflist = NULL;
  	Py_INCREF(klass);
  	inst->in_class = (PyClassObject *)klass;