> 2009/2/18 Neal Becker <ndbeck...@gmail.com>:
> Matthieu Brucher <matthieu.brucher <at> gmail.com> writes:
>
>>
>> B has a reference to A.
>
> Could you be more specific?  Where is this reference stored?  What C api
> functions are used?

I'm probably not qualified to be much more specific, these links
should provide the necessary detail:

http://docs.scipy.org/doc/numpy/reference/c-api.html#numpy-c-api
http://docs.python.org/c-api/intro.html#objects-types-and-reference-counts
http://docs.python.org/extending/newtypes.html

The Python interpreter takes care of when to free the memory
associated with an object once it's reference count reaches zero. The
object reference counts are increased and decreased directly in C code
using the Py_INCREF and Py_DECREF macros whenever a new object is
created or a new pointer assigned to an existing object.

Cheers,
Scott
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to