[redland-dev] Statement ownership of nodes

Dave Beckett dave.beckett at bristol.ac.uk
Tue Jul 27 23:22:17 BST 2004


On Tue, 27 Jul 2004 13:15:02 -0700
Steve Shepard <steveshepard at mac.com> wrote:

> 
> I've spent the last couple of days with librdf. Nice!  A quick
> question:
> 
> The librdf_statement_set_* routines carry the warning:
> 
> "The <node> passed in becomes owned by the statement object and must 
> not be used by the caller after this call."
> 
> I'm curious about the reason for this. If the intent is to prevent the
> 
> deletion of the resource, a better approach would be to adopted the 
> ownership conventions used in the rest of the library and bump the 
> node->usage count. What am I missing?

librdf_statement (an RDF triple) is barely more than
  [3]librdf_node*
so the implentation of the methods are as trivial as you'd expect;
early on they were macros.

It might even be worth moving it to inline functions at some point.

But if it went to the object style, it'd be slightly more heavyweight.
I'm unsure if it'd be good to switch the style without new method names

Dave



More information about the redland-dev mailing list