hb_gcLockItem()

Locks the memory to prevent deallocation by the garbage collector.

Syntax

void hb_gcLockItem( HB_ITEM_PTR pItem );

Arguments

<pItem> The pointer to item structure that will be locked. The passed item can be of any datatype although arrays, objects and codeblocks are locked only. Other datatypes don't require locking so they are simply ignored.

Returns

Nothing.

Description

hb_gcLockItem() is used to lock the memory pointer stored in the passed item structure. It suppres the memory releasing 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 increases the counter. The item is locked if this counter is greather then 0.
Examples
      See source/rtl/setkey.c
Status

Clipper

Compliance

This function is a Harbour extension

Platforms

All

Files

source/vm/garbage.c

See Also