.\" @(#)malloc.3f 1.3 86/01/02 SMI; from UCB 4.2 .TH MALLOC 3F "08 September 1998" .SH NAME malloc, malloc64 \- allocate memory and return the address .SH SYNOPSIS .\" .IX malloc "" \fLmalloc\fP .IX "allocate memory" .IX "memory allocate" .\" .B INTEGER*4 function malloc(nsize) .br .B INTEGER*4 nsize .br in 32-bit environments .sp .B INTEGER*8 function malloc(nsize) .br .B INTEGER*4 nsize .br in 64-bit environments \f2(SPARC only)\f1 .sp .B INTEGER*8 function malloc64(nsize) .br .B INTEGER*8 nsize .br in all environments \f2(SPARC only)\f1 .SH DESCRIPTION The function .B MALLOC(NSIZE) allocates an area of memory, and returns the address of the start of that area. The argument to the function is an integer that specifies the amount of memory to be allocated, in bytes. If successful, it returns a pointer to the first element of the region; otherwise, it returns an integer 0. .PP Typically, the variable receiving the result from .B MALLOC or .B MALLOC64 is declared .B POINTER. .PP The region of memory is not initialized in any way \(em assume it is random bits. .PP When compiled to run in a 64-bit environment, MALLOC takes an INTEGER*4 argument and returns an INTEGER*8 value. Otherwise, it returns a 32-bit INTEGER*4 value .PP The function .B MALLOC64 takes an INTEGER*8 argument and always returns an INTEGER*8 result. Use this function in programs that are intended to run in both 32-bit and 64-bit environments. Be sure that variables receiving the result from .B MALLOC64 are declared INTEGER*8 or POINTER. .SH NOTES Compiling to run in a 64-bit environment means compiling the program with \f3-xarch=v9|v9a\f1 and executing on a 64-bit SPARC V9 or UltraSPARC processor in a 64-bit Solaris operating environment. .SH FILES .B /usr/lang/f77/libF77.a .SH "SEE ALSO" .BR free (3F)