Topic Path: Symbol Reference > Classes > TIdBuffer Class > TIdBuffer Methods > CompactHead Method
ContentsIndexHome
PreviousUpNext
TIdBuffer.CompactHead Method

Removes unused storage space allocated at the head of the buffer.

procedure CompactHead(
    ACanShrink: Boolean = True
);
Parameters 
Description 
ACanShrink 
Indicates unused storage space at the head of the buffer should be removed from the buffer size. Default value is True. 

CompactHead is a procedure used to remove unused storage space at the head of the buffer, and to optionally reduce the number of bytes in the storage area for the buffer. 

If there are unused bytes in the storage area for the buffer (resulting from calls to Remove, Extract, or Write), CompactHead will use the CopyTIdBytes procedure to reallocate storage at the head of the buffer. 

ACanShrink indicates that unused storage space at the head of the buffer should be removed from the total number of bytes in the buffer. The default value is True. If the Capacity for the buffer is too large (in excess of Size and the value in GrowthFactor), the length of the storage area is adjusted to reduce memory requirements. 

When ACanShrink is False, excess storage at the tail of the buffer is unaffected.

Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.