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


14.3 Reference counting

Function: Marpa_Bocage marpa_b_ref (Marpa_Bocage b)

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

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

Function: void marpa_b_unref (Marpa_Bocage b)

Decreases the reference count by 1, destroying b once the reference count reaches zero. When b is destroyed, the reference count of its parent recognizer is decreased by 1. If this takes the reference count of the parent recognizer to zero, it too is destroyed. If the parent recognizer is destroyed, the reference count of its base grammar is decreased by 1. If this takes the reference count of the base grammar to zero, it too is destroyed.