Visit Mozilla.org

PR CALLOC

From MDC


< NSPR API Reference < Memory Management Operations

Allocates and clears memory of a given size from the heap.

Contents

[edit] Syntax

#include <prmem.h>

void * PR_CALLOC(_size);

[edit] Parameters

_size
The size of the memory to be allocated.

[edit] Returns

An untyped pointer to the resized memory, or if the allocation attempt fails, NULL. Call PR_GetError() to retrieve the error returned by the libc function calloc().

[edit] Description

This macro allocates a block of memory of the specified size from the heap and clears the memory.