Specifications
Image Creation and Access
4-27
4
Memory Allocation Functions
Functions of the ipl?Malloc() group allocate aligned memory blocks for
the image data. The size of allocated memory is specified by the
size
parameter. The “?”inipl?Malloc() stands for w, i, s,ord; these letters
indicate the data type in the function names as follows:
iplMalloc() byte
iplwMalloc() 16-bit word
ipliMalloc() 32-bit double word
iplsMalloc() 4-byte single floating-point element
ipldMalloc() 8-byte double floating-point element
NOTE. The only function to free the memory allocated by any of these
functions is
iplFree().
Malloc
Allocates memory aligned to
an 8-byte boundary.
void* iplMalloc(int
size
);
size
Size (in bytes) of memory block to allocate.
Discussion
The iplMalloc() function allocates memory block aligned to an 8-byte
boundary. To free this memory, use
iplFree().
Return Value
The function returns a pointer to an aligned memory block. If no memory
is available in the system, then the
NULL value is returned.