xHarbour Reference Documentation > Function Reference |
Pre-allocates memory for a large hash.
HAllocate( <hHash>, <nCount> ) --> NIL
The function returns always NIL.
The function is used to pre-allocate memory for an empty hash or to reduce its pre-allocated size. When the number of key/value pairs to collect in a hash is approximately known in advance, it can be useful to pre-allocate memory for it so that the time to grow a hash and allocate memory for it is reduced to a minimum. To reduce memory pre-allocated in excess, call HAllocate() with a small value for <nCount>.
The function is provided in case huge hashes must be built and performance is at stake. Normally, the partitioning of hashes using HSetPartition() is more effective in creating large hashes.
See also: | Hash(), HSetPartition() |
Category: | Hash functions , xHarbour extensions |
Source: | vm\hash.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
http://www.xHarbour.com