Implicitly allocating an LO handle

Any of the smart-large-object creation functions can allocate memory for an LO handle when you specify a NULL-valued pointer for the last argument.

For a list of smart-large-object creation functions, see Smart-large-object creation functions

For example, the following code fragment declares a pointer to an LO handle named LO_hdl, initializes it to NULL, and then calls the mi_lo_create() function to allocate memory for this LO handle:
MI_CONNECTION *conn;
MI_LO_SPEC *LO_spec;
MI_LO_HANDLE *LO_hdl = NULL; /* request allocation */
MI_LO_FD LO_fd;
mi_integer flags;
...
LO_fd = mi_lo_create(conn, &LO_spec, flags, &LO_hdl);

After the execution of mi_lo_create(), the LO_hdl variable is a pointer to the new LO handle, which identifies the location of the new smart large object.

Server only: This new LO handle has a default memory duration of PER_ROUTINE. If you switch the memory duration, the creation function uses the current memory duration for the LO handle that it allocates.

If you provide an LO-handle pointer that does not point to NULL, the smart-large-object creation function assumes that memory has already been allocated for the LO handle and it uses the LO handle that you provide.