System.TMarshal.ReallocMem
Delphi
class function ReallocMem(OldPtr: TPtrWrapper; NewSize: NativeInt): TPtrWrapper;
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | System.pas | System | TMarshal |
Description
Allocates and returns a block of memory.
- If
OldPtris nil, ReallocMem allocates a new block of memory of sizeNewSize. - If
NewSizeis 0, ReallocMem returns a nil wrapped pointer. - Otherwise, ReallocMem resizes the existing block, or allocates a new block and copies the old data to it and returns it.