malloc (SunOS) malloc (SunOS)
NAME
malloc, free, realloc, calloc, mallopt, mallinfo, alloca, valloc - Pro‐
vides a memory allocator
DIGITAL UNIX SYNOPSIS
#include <stdio.h> #include <malloc.h>
void *malloc(
size_t size);
#include <alloca.h> char *alloca(
int size);
void free(
void ∗pointer);
void *realloc(
void ∗pointer,
size_t size);
int mallopt(
int command,
int value;
struct mallinfo mallinfo(void);
void *calloc(
size_t num_of_elts,
size_t elt_size);
void *valloc( /* libc.a version */
size_t size); /* returns pointer to void */
char *valloc( /* libbsd.a */
size_t size); /* returns pointer to char */
PARAMETERS
Specifies a number of bytes of memory. Points to the block of memory
that was returned by the malloc() or calloc() function. Specifies a
mallopt() function command. Specifies M_MXFAST, M_NLBLKS, M_GRAIN, or
M_KEEP. Specifies the number of elements in the array. Specifies the
size of each element in the array.
DIFFERENCES
Requires malloc.h; changes declaration of malloc(), calloc(), and real‐
loc() to void.
Changes declaration of size, nelem, elsize to size_t. Adds the
mallinfo(), alloca(), and mallopt() routines.
RELATED INFORMATION
Digital UNIX Functions:
malloc(3), malloc(5) delim off
malloc (SunOS)