The mi_named_free() function
The mi_named_free() function frees a block of named memory.
Syntax
void mi_named_free(mem_name, duration)
mi_string *mem_name;
MI_MEMORY_DURATION duration;
- mem_name
- The null-terminated name of an existing named-memory block.
- duration
- A value that specifies the memory duration of the named-memory
block to free. Valid values for duration are:
- PER_ROUTINE
- For the duration of one iteration of the UDR
- PER_COMMAND
- For the duration of the execution of the current subquery
- PER_STATEMENT (Deprecated)
- For the duration of the current SQL statement
- PER_STMT_EXEC
- For the duration of the execution of the current SQL statement
- PER_STMT_PREP
- For the duration of the current prepared SQL statement
- PER_TRANSACTION
- For the duration of one transaction
- PER_SESSION
- For the duration of the current client session
- PER_SYSTEM
- For the duration of the database server execution
Valid in client LIBMI application? | Valid in user-defined routine? |
---|---|
No | Yes |
Usage
The mi_named_free() function frees a named-memory block based on its memory duration of duration and its name, which mem_name references. To conserve resources, use the mi_named_free() function to explicitly deallocate the named memory once your DataBlade API module no longer needs it. The mi_named_free() function is the destructor function for named memory. If you do not explicitly free named memory, the database server frees it when its memory duration expires.
If mem_name references a named-memory block that was already freed or does not reference a named-memory block, the mi_named_free() function does not return a value. The function returns silently in all cases, even when it cannot find mem_name.
Return values
None.