[Python-checkins] CVS: python/dist/src/Include object.h,2.79.2.16,2.79.2.17

Guido van Rossum gvanrossum@users.sourceforge.net
Tue, 19 Jun 2001 05:26:48 -0700


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

Modified Files:
      Tag: descr-branch
	object.h 
Log Message:
- Rename the (#ifdef COUNT_ALLOCS) counter tp_free to tp_frees.

- Add a new slot, tp_free, which will be a low-level "free object's
  memory" callback.


Index: object.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/object.h,v
retrieving revision 2.79.2.16
retrieving revision 2.79.2.17
diff -C2 -r2.79.2.16 -r2.79.2.17
*** object.h	2001/06/17 23:13:39	2.79.2.16
--- object.h	2001/06/19 12:26:46	2.79.2.17
***************
*** 273,276 ****
--- 273,277 ----
  	allocfunc tp_alloc;
  	newfunc tp_new;
+ 	destructor tp_free; /* Low-level free-memory routine */
  	PyObject *tp_bases;
  	PyObject *tp_mro; /* method resolution order */
***************
*** 280,284 ****
  	/* these must be last and never explicitly initialized */
  	int tp_allocs;
! 	int tp_free;
  	int tp_maxalloc;
  	struct _typeobject *tp_next;
--- 281,285 ----
  	/* these must be last and never explicitly initialized */
  	int tp_allocs;
! 	int tp_frees;
  	int tp_maxalloc;
  	struct _typeobject *tp_next;
***************
*** 460,465 ****
  #ifndef Py_TRACE_REFS
  #ifdef COUNT_ALLOCS
! #define _Py_Dealloc(op) ((op)->ob_type->tp_free++, (*(op)->ob_type->tp_dealloc)((PyObject *)(op)))
! #define _Py_ForgetReference(op) ((op)->ob_type->tp_free++)
  #else /* !COUNT_ALLOCS */
  #define _Py_Dealloc(op) (*(op)->ob_type->tp_dealloc)((PyObject *)(op))
--- 461,466 ----
  #ifndef Py_TRACE_REFS
  #ifdef COUNT_ALLOCS
! #define _Py_Dealloc(op) ((op)->ob_type->tp_frees++, (*(op)->ob_type->tp_dealloc)((PyObject *)(op)))
! #define _Py_ForgetReference(op) ((op)->ob_type->tp_frees++)
  #else /* !COUNT_ALLOCS */
  #define _Py_Dealloc(op) (*(op)->ob_type->tp_dealloc)((PyObject *)(op))