Updated: April 19, 2023 |
Allocate space for an array
#include <malloc.h> void* _scalloc( size_t size );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The _scalloc() functions allocate space for an array of length size bytes. Each element is initialized to 0.
You must use _sfree() to deallocate the memory allocated by _scalloc().
A pointer to the start of the allocated memory, or NULL if there's insufficient memory available or if the size is zero.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |