Allocate memory in blocks
#include <malloc.h> void* _smalloc( size_t size );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The _smalloc() function allocates space for an object of size bytes. Nothing is allocated when the size argument has a value of zero.
You must use _sfree() to deallocate the memory allocated by _smalloc().
A pointer to the start of the allocated memory, or NULL if there's insufficient memory available, or if the requested size is zero.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |