[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Kernel and Subsystems, Volume 1

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

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

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.

Related Information

The rmalloc kernel service.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]