MALLOC(3F)MALLOC(3F)NAME
malloc, malloc64 - allocate memory and return the address
SYNOPSIS
function malloc(nsize)
[integer] nsize
integer*8 function malloc64(nsize)
integer*8 nsize
DESCRIPTION
The intrinsic function 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 allo‐
cated, in bytes. If successful, it returns a pointer to the first ele‐
ment of the region; otherwise, it returns an integer 0.
Typically, the variable receiving the result from malloc or malloc64 is
declared pointer.
The region of memory is not initialized in any way — assume it is ran‐
dom bits.
malloc() is an intrinsic function and does not need an explicit type
declaration. It returns integer*8 in 64-bit environments, and inte‐
ger*4 in 32-bit environments. nsize can be an integer of any size.
The function 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 malloc64 are declared integer*8 or pointer.
NOTES
Compiling to run in a 64-bit environment means compiling the program
with -m64 and executing on a 64-bit processor in a 64-bit operating
environment.
FILES
libfui.a
SEE ALSOfree(3F)
02 February 2010 MALLOC(3F)