Digital UNIX Diffs - malloc(5) Digital UNIX Diffs - malloc(5)NAME
malloc, alloca, realloc, calloc, valloc - Provides a memory allocator
LIBRARY
Standard C Library (libc.a) Berkeley Compatibility Library (libbsd.a)
Pthreads library (libpthreads.a)
SYNOPSIS
#include <malloc.h>
void *malloc ( size_t size );
#include <alloca.h> char *alloca ( int size );
void *realloc ( void *pointer,
size_t size );
void *calloc ( size_t num_of_elts,
size_t elt_size );
void *valloc ( size_t size ); /* libc.a version */
/* returns pointer to void */
char *valloc ( size_t size ); /* libbsd.a version */
/* returns pointer to char */
PARAMETERS
size Specifies a number of bytes of memory.
pointer Points to the block of memory that was returned by the
malloc() or calloc() function.
num_of_elts Specifies the number of elements in the array.
elt_size Specifies the size of each element in the array.
DIFFERENCESalpha-32bits(5): 32 vs 64 bit Differences
Memory allocation library functions such as malloc() guarantee to
return data aligned to the maximum alignment of any object. In the
64-bit Alpha AXP environment, malloc() returns a pointer to memory that
is at least quadword aligned.
If the size parameter is specified to be 0 (zero), the malloc() func‐
tion returns a null pointer.
RELATED INFORMATION
Functions: malloc(3), alloca(3), realloc(3), calloc(3), valloc(3)CATEGORY INDEXalpha-32bits(5)
delim off
Digital UNIX Diffs - malloc(5)