stMemAlloc function
PVOID stMemAlloc(
  SIZE Size

Size of the memory block to allocate.

Return value:

Pointer to newly allocated memory block or NULL on failure.


Function allocates a memory block with defined size. If function succeeds, it will return pointer to newly allocated memory block. On failure, it will return NULL. To get extended information about failure use stGetLastError function. Allocated memory areas can be released by using stMemFree function.

If memory management functions are inactive for alternative C library (constant ST_USE_MALLOC_CLIB is set to 1), the stMemAlloc function will allocate memory by using malloc function from standard C library.

If memory management functions are active for alternative C library, function will allocate memory by using stMemoryAlloc, with memory pool, that is defined in stMemoryPoolvariable. In case you need more information, please refer to its description.

Header file:ST_CLIB.h (include ST_API.h)
See also: memory management, NULL, PVOID, SIZE, ST_USE_MALLOC_CLIB, stGetLastError, stMemoryPool, stMemFree, stMemoryAlloc
SpaceShadow documentation