hb_gcUnlockItem()
Unlocks the memory to prevent deallocation by the garbage collector.
- Syntax
-
- void hb_gcUnlockItem( HB_ITEM_PTR pItem );
- Arguments
-
- <pItem> The pointer to item structure that will be unlocked. The passed item can be of any datatype although arrays, objects and codeblocks are unlocked only. Other datatypes don't require locking so they are simply ignored.
- Returns
-
- Nothing.
- Description
-
- hb_gcUnlockItem() is used to unlock the memory pointer stored in the passed item structure that was previously locked with hb_gcLockItem() call. It allows to release the memory during garbage collecting if the garbage collector will not find any reference to this pointer. The garbage collector is storing the lock counter - every call of this function decreases the counter. This function doesn't deallocate memory stored inside the item - the memory can be deallocated however during the closest garbage collecting if the lock counter is equal to 0 and the memory pointer is not referenced by any harbour level variable.
Examples
See source/rtl/setkey.c
- Status
- Clipper
- Compliance
-
- This function is a Harbour extension
- Platforms
-
- All
- Files
-
- source/vm/garbage.c
- See Also