stMemoryAlloc Function
Declaration:
PVOID stMemoryAlloc(
  PVOID MemoryPool,
  SIZE Size
);
Parameters:
MemoryPool

Address of the memory pool.

Size

Size of the memory block to be allocated.

Return value:

Pointer to the newly allocated memory block or NULL on failure. Use the stGetLastError function to obtain extended error information.

Description:

This function allocates a memory block of a specified size within the designated memory pool. Allocated addresses are always aligned to the value specified in AR_MEMORY_ALIGNMENT, relative to the start of the memory pool. On success, it returns a pointer to the newly allocated memory block. On failure, it returns NULL. Use the stGetLastError function to obtain extended error information.

This function will be excluded from compilation if memory management functions are disabled by setting ST_USE_MEMORY to 0.

SpaceShadow documentation