faqts : Computers : Programming : Languages : Python : Common Problems : C/C++ Code

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

7 of 8 people (88%) answered Yes
Recently 2 of 2 people (100%) answered Yes

Entry

Can I explicitly request garbage collection from C?

Jun 9th, 2000 00:10
unknown unknown, Courageous


Things are destroyed instantly when their reference counts reach zero. 
There's a function somewhere that prints out an object's reference 
count; that's probably what you want. Either that, or if you're writing 
a C extension, you can examine the object's reference count directly. In 
virtually all cases, it will be one higher than you expect, because the 
tuple that was sent as an argument to your external function also 
happens to own a reference to your object.