[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Classes' (#rtl)

TMemoryStream.Realloc

Sets the new capacity for the memory stream

Declaration

Source position: classesh.inc line 889

protected function TMemoryStream.Realloc(

  var NewCapacity: LongInt

):Pointer; virtual;

Description

SetCapacity sets the capacity of the memory stream, i.e. does the actual allocation or de-allocation of memory for the stream. It allocates at least NewCapacity bytes on the heap, moves the current contents of the stream to this location (as much as fits in) and returns the new memory location. Extra allocated memory is not initialized, i.e. may contain garbage.

Memory is allocated in blocks of 4 Kb; this can be changed by overriding the method.

See also

TMemoryStream.Capacity

  

Current capacity of the stream.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.