Next: , Previous: , Up: Ordering methods   [Contents]

15.3 Reference counting

Function: Marpa_Order marpa_o_ref ( Marpa_Order o)

Increases the reference count by 1. Not needed by most applications.

Return value: On success, o. On failure, NULL.

Function: void marpa_o_unref ( Marpa_Order o)

Decreases the reference count by 1, destroying o once the reference count reaches zero. Beginning with o’s parent bocage, Libmarpa then proceeds up the chain of parent objects. Every time a child is destroyed, the reference count of its parent is decreased by 1. Every time the reference count of an object is decreased by 1, if that reference count is now zero, that object is destroyed. Libmarpa follows this chain of decrements and destructions as required, all the way back to the base grammar, if necessary.