Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r413:89d424825a45
Date: 2012-06-17 19:16 +0200
http://bitbucket.org/cffi/cffi/changeset/89d424825a45/

Log:    Add a warning.

diff --git a/doc/source/index.rst b/doc/source/index.rst
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -356,7 +356,10 @@
 memory: when this exact object is garbage-collected, then the memory is
 freed.  If, at the level of C, you store a pointer to the memory
 somewhere else, then make sure you also keep the object alive for as
-long as needed.
+long as needed.  (This also applies if you immediately cast the returned
+pointer to a pointer of a different type: only the original object has
+ownership, so you must keep it alive.  As soon as you forget it, then
+the casted pointer will point to garbage.)
 
 The cdata objects support mostly the same operations as in C: you can
 read or write from pointers, arrays and structures.  Dereferencing a
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to