Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Harbour Version 0.37 (c) reference Guid - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

hb_gcAlloc()

Allocates memory that will be collected by the garbage collector.
---------------------------------------------------------------------------------

 Syntax

        #include <hbapi.h>  
        void *hb_gcAlloc( ULONG ulSize,  
        HB_GARBAGE_FUNC_PTR pCleanupFunc );  

 Arguments

        <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.

 Examples

      See source/vm/arrays.c

Status

      Clipper

 Compliance

      This function is a Harbour extension

 Platforms

      All

 Files

      source/vm/garbage.c

See Also: hb_gcFree()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson