mirror of
https://github.com/QB64Official/qb64.git
synced 2024-08-31 00:40:17 +00:00
28 lines
1.1 KiB
Text
28 lines
1.1 KiB
Text
|
The '''SETMEM''' function is used to increase, decrease or return the current "far heap" byte size.
|
||
|
|
||
|
|
||
|
|
||
|
{{PageSyntax}}
|
||
|
:: SETMEM(byte_size)
|
||
|
|
||
|
|
||
|
|
||
|
''Description:''
|
||
|
*'''[[Keywords currently not supported by QB64|Currently NOT supported in QB64!]]'''
|
||
|
* SETMEM(0) returns the total number of bytes currently in the far heap memory area.
|
||
|
* The byte size indicates the number of bytes to increase or decrease the far heap.
|
||
|
:* If the byte size is negative, SETMEM decreases the far heap by the indicated number of bytes.
|
||
|
:* If the byte size is positive, SETMEM '''attempts''' to increase the far heap space by the number of bytes.
|
||
|
* If SETMEM cannot change the far heap by the requested number of bytes, it reallocates as many bytes as possible.
|
||
|
* SETMEM can be used in mixed-language programming to decrease the far heap space so procedures in other languages can dynamically allocate far memory.
|
||
|
|
||
|
|
||
|
:'''Note: A first call to SETMEM trying to increase the far heap has no effect because Basic'''
|
||
|
::'''allocates as much memory as possible to the far heap when a program starts.'''
|
||
|
|
||
|
|
||
|
''See also:''
|
||
|
* [[DECLARE (non-BASIC statement)]]
|
||
|
|
||
|
|
||
|
{{PageNavigation}}
|