INFORMIX
DataBlade API Programmer's Manual
Chapter 12: DataBlade API Function Descriptions
Home Contents Index Master Index New Book

mi_free()

The mi_free() routine frees the memory referenced by a pointer if that memory was previously allocated with mi_alloc(), mi_dalloc(), or mi_zalloc().

Syntax

Usage

The mi_free() routine does not free memory allocated with malloc().

The mi_free() routine requires the inclusion of mitypes.h.

A client application must call mi_free() to free memory that it has allocated with mi_alloc(), mi_dalloc(), or mi_zalloc(), or the memory will not be freed until the client exits.

In a server application, memory allocated with mi_alloc(), mi_dalloc(), or mi_zalloc() is automatically freed by the database server after a specified duration. Memory allocated with PER_FUNCTION duration is freed when the function returns. Memory allocated with PER_COMMAND duration is freed when the statement or command terminates. You should explicitly mi_free() memory allocated by mi_alloc(), mi_dalloc(), or mi_zalloc() if that memory is no longer needed.

For information about setting and changing the duration of allocated memory in server functions, see the descriptions of the mi_alloc() and mi_switch_mem_duration() functions.

Return Values

None.

Related Topics

For additional information, see the descriptions of the following functions: mi_alloc(), mi_dalloc(), mi_switch_mem_duration(), and mi_zalloc().




DataBlade API Programmer's Manual, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.