Allocate user memory (Server)
To handle dynamic memory allocation of user memory, use
one of the following DataBlade
API memory-management
functions.
Memory-allocation task | DataBlade API function |
---|---|
To allocate user memory with the current memory duration | mi_alloc() |
To allocate user memory with a specified memory duration | mi_dalloc() |
To allocate user memory with the current memory duration that is initialized with zeros | mi_zalloc() |
These user-memory-allocation functions allocate memory
from the shared memory of the database server at a particular memory
duration.
Tip: The DataBlade
API library
also provides memory-management functions to manage named memory.
These named-memory-management functions are advanced functions. Use
them only when user-memory-management functions cannot perform the
task you need done. For more information, see Manage named memory.