Manually prompting garbage collection

Kyle Lanclos lanclos at ucolick.org
Thu Jul 17 01:56:56 CEST 2008


Fredrik Lundh wrote:
> what magic do you expect the "manual garbage collection" to do here that 
> the DECREF doesn't already do?

The DECREF decrements the reference count, but does not immediately prompt
garbage collection when the reference count drops to zero; that garbage
collection does not appear to occur until I return from the particular C
function I am in the middle of executing.

Ideally, I want to explicitly prompt garbage collection in the middle
of a C function, without first returning to the larger Python interpreter.

--Kyle



More information about the Python-list mailing list