xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_GCAll()

Scans the memory and releases all garbage memory blocks.

Syntax

HB_GCAll( [<lForce>] ) --> NIL

Arguments

<lForce>
Passing .T. (true) enforces a complete garbage collection, even if there are only few memory objects to collect. If <lForce> is omitted, or set to .F. (false), the garbage collector is not invoked when there is little or no garbage to collect.

Return

The return value is always NIL.

Description

xHarbour's garbage collector is normally invoked automatically during idle states. An idle state is the state of the xHarbour virtual machine (VM) when it waits for user input from the keyboard or the mouse. The VM enters idle state during Inkey() calls. All applications that do not use Inkey() function calls can signal the idle state with a call to the HB_IdleState() function.

Alternatively, garbage collection can be enforced programmatically with HB_GCAll(.T.). This can be advantageous when there is massive use of memory during a loop, for exemple, that includes no user input and no idle state is signalled.

Info

See also:HB_GCStep(), HB_IdleState(), Memory()
Category: Debug functions , Environment functions , xHarbour extensions
Source:vm\garbage.c
LIB:xhb.lib
DLL:xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe