Public Member Functions
|GarbageLock (const Item &itm)|
|Creates a garbage lock protecting an item. |
|Creates an empty garbage lock. |
|Item &||item ()|
|Return the guarded item. |
|const Item &||item () const|
|Return the guarded item (const version). |
|Releases the item that can now be collected. |
This class safely store an item, and all its contents in case it is a sort of container, from being collected. The garbage locked items are marked as soon as they reach the lowest possible value in the live generation count. Extensions are granted to have their gcMark() method called when this happens, so any kind of item can be safely stored as the item() element.
Once destroyed, the garbage lock releases the item, that can then be immediately collected.
Creates an empty garbage lock.
The item inside this garbage lock is nil.
|Falcon::GarbageLock::GarbageLock||(||const Item &||itm||)|
Creates a garbage lock protecting an item.
Releases the item that can now be collected.
Return the guarded item.
The returned value can be modified. For example, setting it to nil or to another flat value will cause the previously guarded value to be released, and collectible for garbage.
|const Item& Falcon::GarbageLock::item||(||)|| const
Return the guarded item (const version).
|friend class MemPool