Рейтинг:  0 / 5

Звезда не активнаЗвезда не активнаЗвезда не активнаЗвезда не активнаЗвезда не активна
 

hb_gcAlloc()

 

Allocates memory that will be collected by the garbage collector.

 

Syntax

 

#include "hbapi.h" void * hb_gcAlloc( HB_SIZE nSize,

 

PHB_GARBAGE_FUNC pCleanupFunc );

 

Argument(s)

 

<ulSize> Requested size of memory block

 

<pCleanupFunc> Pointer to HB_GARBAGE_FUNC function that will be called directly before releasing the garbage memory block or NULL. This function should release all other memory allocated and stored inside the memory block. For example, it releases all items stored inside the array. The functions receives a single parameter: the pointer to memory allocated by hb_gcAlloc().

 

Returns

 

The pointer to allocated memory or it generates an internal unrecoverable error.

 

Description

 

hb_gcAlloc() is used to allocate the memory that will be tracked by the garbage collector. It allows to properly release memory in case of self-referencing or cross-referencing harbour level variables. Memory allocated with this function should be released with hb_gcFree() function or it will be automatically deallocated by the GC if it is not locked or if it is not referenced by some harbour level variable.

 

Status

 

Unknown 'STATUS' code: 'C'

 

Compliance

 

This is Harbour specific

 

Platform(s)

 

This is available on all platforms

 

See also

hb_gcFree()