stMemoryExpand Function
Declaration:
BOOL stMemoryExpand(
  PVOID MemoryPool,
  PVOID MemoryAddress,
  SIZE MemorySize
);
Parameters:
MemoryPool

Address of the memory pool.

MemoryAddress

Base address of the memory region to be added to the specified memory pool.

MemorySize

Size of the memory region.

Return value:

TRUE on success or FALSE on failure. Use the stGetLastError function to obtain extended error information.

Description:

This function allows attaching additional memory areas to a single, cohesive memory pool. The memory pool must first be initialized using the stMemoryInit function. Integrating new areas enables memory block allocations to be distributed across all regions defined within the memory pool. This facilitates the use of multiple memory segments or the definition of reserved memory addresses.

The value provided in the MemoryAddress parameter must not be NULL, as this value is reserved by the memory management module to indicate undefined areas. To use memory starting at the base address (0x00...), use the stMemoryInit function to declare that area as the initial pool.

If multiple memory areas are not required, this function can be excluded from compilation by setting ST_MEMORY_EXPAND_FUNC to 0. Additionally, the function will not be compiled if memory management functions are disabled by setting ST_USE_MEMORY to 0.

SpaceShadow documentation