FORTRAN 77 Language Reference

Deallocation of Memory by FREE() Subroutine

The subroutine FREE() deallocates a region of memory previously allocated by MALLOC(). The argument given to FREE() must be a pointer previously returned by MALLOC(), but not already given to FREE(). The memory is returned to the memory manager, making it unavailable to the programmer.

Example: Deallocate via FREE:


	POINTER ( P1, X ), ( P2, Y ), ( P3, Z ) 
	... 
	P1 = MALLOC ( 10000 ) 
	... 
	CALL FREE ( P1 ) 
	... 

In the above example, MALLOC() allocates 10,000 bytes of memory, which are associated with pointer P1. FREE() later returns those same 10,000 bytes to the memory manager.