Navigation:  ThinBASIC Modules > Core (thinBasic Core Engine) > Memory handling > Heap memory >

HEAP_Realloc

Previous pageReturn to chapter overviewNext page

 

Description

 

Allocates or reallocate a block of memory from a heap.

If the function succeeds, the return value is a pointer to the allocated memory block.

 

Syntax

 

ptr = HEAP_ReAlloc(OldPtr, Size)

 

Returns

 

Number: pointer to the allocated memory area.

If returned value is zero, an error has occurred.

 

Parameters

 

Name

Type

Optional

Meaning

OldPtr

Number

No

Pointer to a previously allocated heap memory. If zero, a new block of memory will be allocated.

Size

Number

No

Number of bytes to allocate.

 

Remarks

 

Restrictions

 

See also

 

Examples