Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/_smalloc.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/_smalloc.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/_smalloc.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/_smalloc.html on line 8

_smalloc()

Allocate memory in blocks

Synopsis:

#include <malloc.h>

void* _smalloc( size_t size );

Arguments:

size
The size of the block to allocate, in bytes.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.


Note: This function is in libc.a, but not in libc.so (in order to save space).

Description:

The _smalloc() function allocates space for an object of size bytes. Nothing is allocated when the size argument has a value of zero.


Note: This function allocates memory in blocks of _amblksiz bytes; _amblksiz is a global variable defined in <stdlib.h>.

You must use _sfree() to deallocate the memory allocated by _smalloc().

Returns:

A pointer to the start of the allocated memory, or NULL if there's insufficient memory available, or if the requested size is zero.

Classification:

QNX Neutrino

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes

See also:

calloc(), free(), realloc(), _scalloc(), _sfree(), _srealloc()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/_smalloc.html on line 146

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/_smalloc.html on line 146