OwnedCPtr¶
Import: import system;
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
OwnedCPtr¶
A C pointer returned by an @owned("free_fn") @c extern: Dream owns it, and the destructor calls free_fn(ptr) unless take() handed ownership back first.
free_with¶
Releases ptr by calling the foreign function at address free.
get¶
The pointer, still owned (and later freed) by this object.
take¶
Gives up ownership: the caller now frees the returned pointer, and this object holds NULL.