[Previous] [Contents] [Next]

_sfree()

Deallocate a block of memory

Synopsis:

#include <malloc.h>

void _sfree( void *ptr,
             size_t size );

Library:

libc

Description:

When the value of the argument ptr is NULL, the _sfree() function does nothing; otherwise, the _sfree() function deallocates size bytes of memory located by the argument ptr, which was previously returned by a call to the appropriate version of _scalloc() or _smalloc(). After the call, the freed block is available for allocation.

Classification:

QNX 6

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

Caveats:

Calling _sfree() on a pointer already deallocated by a call to _sfree() could corrupt the memory allocator's data structures.

The size must match the size of the allocated block.

See also:

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


[Previous] [Contents] [Next]