rmfree Kernel Service

Purpose

Frees memory allocated by the rmalloc kernel service.

Syntax

#include <sys/types.h>

int rmfree ( pointer,  size)
caddr_t pointer
int size

Parameters

Item Description
pointer Specifies the address of the area in memory to free.
size Specifies the size of the area in memory to free.

Description

The rmfree kernel service frees the area of memory pointed to by the pointer parameter in the contiguous real memory heap. This area of memory must be allocated with the rmalloc kernel service, and the pointer must be the pointer returned from the corresponding rmalloc kernel service call. Also, the size must be the same size that was used on the corresponding rmalloc call.

Any memory allocated in a prior rmalloc call must be explicitly freed with an rmfree call. This service can be called from the process environment only.

Return Values

Item Description
0 Indicates successful completion.
-1 Indicates one of the following:
  • The area was not allocated by the rmalloc kernel service.
  • The heap was not initialized for memory allocation.