ImageGear Professional v18.2 > API Reference Guide > Core Component API Reference > Core Component Callback Functions Reference > LPFNIG_MEM_ALLOC |
Create a function of this type to give your application the flexibility of replacing ImageGear's memory allocation routine with your own.
Copy Code
|
|
---|---|
typedef LPBYTE (ACCUAPI LPFNIG_MEM_ALLOC)(AT_UINT nSize); |
Name | Type | Description |
nSize | AT_UINT | Number of bytes to allocate. |
The user supplied callback function should return a pointer to the allocated block of memory.
This function does not process image pixels.
Copy Code
|
|
---|---|
/**************************************************************/ /* Memory Alloc callback function definition */ /*************************************************************/ LPBYTE ACCUAPI MyMemAlloc(AT_UINT nSize) /* number of bytes to alloc*/ { /* Put your own memory allocation code here */ return( buffer); }; /*See also example for IG_mem_CB_register() */ |
This callback function is registered by calling IG_mem_CB_register(). The register function must be called prior to any user-defined callback functions being used by the ImageGear library.
Your memory allocation function will only be used when large allocations (allocations greater than 1024) are performed. |