Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

CFI_deallocate

C function prototype: Deallocates memory for an object described by a C descriptor.

int CFI_deallocate (CFI_cdesc_t *dv);

Formal Parameters:

dv

The address of a C descriptor describing the object. It must have been allocated using the same mechanism as the Fortran ALLOCATE statement. If the object is a pointer, it must be associated with a target satisfying the conditions for successful deallocation by the Fortran DEALLOCATE statement.

Description

Successful execution of CFI_deallocate deallocates memory for the object using the same mechanism as the Fortran DEALLOCATE statement, and the base_addr member of the C descriptor becomes a null pointer.

If an error is detected, the C descriptor is not modified.

Result Value

The result is an error indicator.

Example

If dv is the address of a C descriptor for the Fortran array A declared as follows:

REAL, ALLOCATABLE :: A(:, :)

and the array is allocated, the following code deallocates it:

int ind;
ind = CFI_deallocate(dv);