[redland-dev] implicit free

Maxence Guesdon Maxence.Guesdon at inria.fr
Fri Nov 25 12:58:46 CET 2011


On Fri, 25 Nov 2011 12:28:41 +0200
Lauri Aalto <laalto at gmail.com> wrote:

> Hello,
> 
> from docs http://librdf.org/docs/api/redland-statement.html#librdf-new-statement-from-nodes
> 
> "The node objects become owned by the new statement (or freed on error)."
> 
> Being an owner for some object means being responsible for freeing it.
> Generally, ownership transfers are quite well documented in Redland
> API documentation. If there's no mention of ownership transfer, the
> argument object is copied if needed.
> 
> Also, most objects are reference-counted so copying an object is
> cheap, simply incrementing a usage counter. This implies that the
> objects are shared - modifying one also modifies the copies. If this
> is not what you want, you'll need to implement explicit copy-on-write
> yourself.

Thanks, I missed this sentence and other ones I see now.

Regards,

Maxence


More information about the redland-dev mailing list