Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

IHeap1 functions

IHeap1_ErrMalloc()

//Allocate 2 buffers
                
                nErr = IHeap1_ErrMalloc(me->piRealloc, nLen1, (void **)&pbyMessage1);
                if (AEE_SUCCESS != nErr) {
                goto bail;
                }
                
                nErr = IHeap1_ErrMalloc(me->piRealloc, nLen2, (void **)&pbyMessage2);
                if (AEE_SUCCESS != nErr) {
                goto bail;
                }
            

IHeap1_ErrRealloc()

   if (-1 == nEntry) {
                // no empty slots, allocate some more
                
                int nNewSize = INITIAL_WINDOW_ENTRIES;
                
                // we'll use the first slot in the new block
                nEntry = me->nWindowEntries;
                
                if (me->nWindowEntries > 0) {
                // double the number of entries
                nNewSize = me->nWindowEntries * 2;
                }
                
                nErr = IHeap1_ErrRealloc(piEnv, nNewSize * sizeof(WindowEntry),
                (void **)&me->pWindowEntries);
                if (AEE_SUCCESS != nErr) {
                goto bail;
                }
            

IHeap1_Free()

//Free up allocated block
                IHeap1_Free(cbi->piHeap1, pWalkBuf->p);