[Python-checkins] python/dist/src/Include object.h,2.109,2.110
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
Wed, 07 Aug 2002 13:53:07 -0700
Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv9506/python/Include
Modified Files:
object.h
Log Message:
Added info about the right way to leave the body of a trashcan-protected
destructor early.
Index: object.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/object.h,v
retrieving revision 2.109
retrieving revision 2.110
diff -C2 -d -r2.109 -r2.110
*** object.h 29 Jul 2002 13:42:00 -0000 2.109
--- object.h 7 Aug 2002 20:53:05 -0000 2.110
***************
*** 707,710 ****
--- 707,715 ----
}
+ CAUTION: Never return from the middle of the body! If the body needs to
+ "get out early", put a label immediately before the Py_TRASHCAN_SAFE_END
+ call, and goto it. Else the call-depth counter (see below) will stay
+ above 0 forever, and the trashcan will never get emptied.
+
How it works: The BEGIN macro increments a call-depth counter. So long
as this counter is small, the body of the deallocator is run directly without