hb_gcItemRef()

hb_gcItemRef()

Marks the memory to prevent deallocation by the garbage collector.

Syntax

      void hb_gcItemRef( PHB_ITEM pItem );

Arguments

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

Returns

Nothing.

Description

The garbage collector uses hb_gcItemRef() function during scanning of referenced memory pointers. This function checks the type of passed item and scans recursively all other memory blocks referenced by this item if it is an array, an object or a codeblock.

NOTE: This function is reserved for the garbage collector only. It cannot be called from the user code – calling it can cause unpredicted results (memory blocks referenced by the passed item can be released prematurely during the closest garbage collection).

Compliance

Harbour

Platforms

All

Files

src/vm/garbage.c

Seealso

hb_gcAlloc(), hb_gcFree()

3 responses to “hb_gcItemRef()

  1. Pingback: Harbour All Functions – H | Viva Clipper !

  2. Pingback: Harbour Garbage Collection Functions | Viva Clipper !

  3. Pingback: Harbour RG Summary | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.