Free memory allocated by calls to AllocRemember().
Source position: intuition.pas line 3523
procedure FreeRemember( |
var RememberKey: PRemember; |
ReallyForget: LongInt |
); |
RememberKey |
|
The address of a pointer to struct Remember. This pointer should either be nil or set to some value (possibly nil) by a call to AllocRemember(). |
ReallyForget |
|
A LongBool False or True describing, respectively, whether you want to free up only the Remember nodes or if you want this procedure to really forget about all of the memory, including both the nodes and the memory buffers referenced by the nodes. |
This function frees up memory allocated by the AllocRemember() function. It will either free up just the Remember structures, which supply the link nodes that tie your allocations together, or it will deallocate both the link nodes AND your memory buffers too.
If you want to deallocate just the Remember structure link nodes, you should set the ReallyForget argument to False. However, if you want FreeRemember() to really deallocate all the memory, including both the Remember structure link nodes and the buffers you requested via earlier calls to AllocRemember(), then you should set the ReallyForget argument to True.
Note well: Once you call this function passing it False, the linkages between all the memory chunks are lost, and you cannot subsequently use FreeRemember() to free them.
|
Allocate Memory with tracking to make freeing easy. |
|
|
Free a memory block with given size |
program RememberTest; uses Intuition; var RememberKey: PRemember; begin RememberKey := nil; buffer := AllocRemember(@RememberKey, BUFSIZE, MEMF_CHIP); if Assigned(buffer) then begin // Use the buffer //... end; FreeRemember(@RememberKey, True); end.