This collection provides a set of functions for managing cross-reload global memory and variables, including pointer retrieval, setting and deletion, as well as memory allocation and deallocation.
đź“– Learn More about Global Memory/Variables
◆ GetGlobalPointer()
Gets a pointer from cross-reload global memory map.
- Parameters
-
| id | The memory Unique ID to get the pointer of. |
- Returns
- The retrived global pointer from global memory storage,
nullptr if doesn't exist.
◆ SetGlobalPointer()
Sets a pointer in cross-reload global memory map.
If the memory ID already exists in the global memory map, the old pointer is replaced with the new one.
- Parameters
-
| id | The memory Unique ID to set the pointer of. |
| ptr | The pointer to set. |
- Returns
- The old pointer associated with the memory Unique ID or the new pointer if the memory Unique ID was not previously mapped.
◆ DeleteGlobalPointer()
Deletes a pointer from cross-reload global memory map.
- Parameters
-
| id | The memory Unique ID to delete the pointer of. |
◆ AllocateGlobalMemory()
Allocates and registers a memory block in cross-reload global memory map using a Unique ID.
- Parameters
-
| id | The memory Unique ID for block registration. |
| size | The size of the memory to allocate in bytes. |
- Returns
- Address of the allocated global memory.
◆ FreeGlobalMemory()
Frees and unregisters a memory block from cross-reload global memory map using its Unique ID.
- Parameters
-
| id | The memory Unique ID for block release and unregistration. |
◆ GetGlobalVariable()
Retrieves a cross-reload global variable as Variant using its Unique ID.
- Parameters
-
| id | The Unique ID of the variable to be retrieved. |
- Returns
- The retrieved global variable,
Variant::NIL if variable doesn't exist.
◆ SetGlobalVariable()
Stores a Variant as cross-reload global variable using a Unique ID.
- Parameters
-
| id | The Unique ID for the variable to be stored. |
| var | The Variant to store as global variable. |
◆ ClearGlobalVariables()
| void ClearGlobalVariables |
( |
| ) |
|
Flushes all registered cross-reload global variables.