Create a user-allocated MI_FPARAM structure

The following DataBlade® API functions create a user-allocated MI_FPARAM structure and return a pointer to this newly allocated structure:
  • The mi_fparam_allocate() function allocates an MI_FPARAM structure and returns a pointer to this newly allocated structure.

    This user-allocated MI_FPARAM structure holds the number of arguments that you specify to mi_fparam_allocate().

  • The mi_fparam_copy() function copies an existing MI_FPARAM structure to a new MI_FPARAM structure that the function allocates.

    The user-allocated MI_FPARAM structure holds the same number of arguments as the MI_FPARAM structure that mi_fparam_copy() copied.

Both these functions are constructor functions for an MI_FPARAM structure. They allocate the user-allocated MI_FPARAM structure in the current memory duration. By default, the current memory duration is PER_ROUTINE. For calling a UDR with Fastpath, the PER_ROUTINE memory duration refers to the duration of the calling UDR, not the UDR that you call with Fastpath.

If you have changed the current memory duration with the mi_switch_mem_duration() function, mi_fparam_allocate() or mi_fparam_copy() uses the current memory duration that mi_switch_mem_duration() has specified for the MI_FPARAM structure that it allocates.

If the current memory duration is not acceptable for your use of the MI_FPARAM structure, call mi_switch_mem_duration() with the desired memory duration before the call to mi_fparam_allocate() or mi_fparam_copy(). Keep in mind that when you call mi_switch_mem_duration(), you change the current memory duration for all subsequent memory allocations, including those made by mi_alloc().