Download C Interface to O2 User Manual

Transcript
2
Runtime Library
2.6 Garbage Collection
To clean u p t h e base, you can u se t h e followin g fu n ct ion :
void o2_garbage_base(char *base_name)
Th e o2_garbage_base fu n ct ion collect s t h e u n r each able object s of a
given base. To u se th is fu n ct ion you m u st call it explicit ly fr om t im e t o
t im e.
To pr even t an y t em por ar y r efer en ces on t o per sist en t dat a, you m u st
com m it befor e callin g t h e gar bage collect or . If you do n ot do t h is you
m ay get wild r efer en ces.
Note
As gar bage collection wor k s wit h in a base, t h is m ean s th at t h ose
object s in a par t icu lar base t h at ar e on l y r each able fr om an ot h er base,
will also get gar bage collect ed .
Example
o2_link_commit();
o2_link_transaction();
o2_garbage_base("my_base");
38
C In ter face to O2 User Man u al