| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hzSSR::Free | (unsigned int,unsigned int,) |
Declared in file: hzSSR.h
Defined in file : hzSSR.cpp
Function Logic:
Function body:
hzEcode hzSSR::Free (unsigned int strAddr, unsigned int nSize)
{
_hzfunc("hzSSR::Free") ;
static uint32_t _noCalls = 0;
_ssrFLE* pSlot ;
uint32_t nUnit ;
_noCalls++ ;
if (!strAddr || !nSize)
{
if (!strAddr) threadLog("Warning: Cannot delete null item\n") ;
if (!nSize) threadLog("Warning: Cannot delete zero size item\n") ;
return E_OK ;
}
pSlot = (_ssrFLE*) Xlate(strAddr) ;
if (!pSlot)
return hzerr(E_CORRUPT, "WARNING freeing invalid obj %u:%u of size %u bytes\n", (strAddr & 0xffff0000)>>16,strAddr&0xffff,nSize);
if (pSlot->m_Blank[0]== 0xff)
return hzerr(E_CORRUPT, "WARNING already deleted obj %u:%u of size %u bytes\n", (strAddr & 0xffff0000)>>16,strAddr&0xffff,nSize);
nUnit = (nSize/8)+ (nSize%8? 1:0);
/*
** if (pBloc->m_Alloc[slotNo] != (nSize-1))
** {
** threadLog("TEST: CORRUPT: Address %u:%u has size %u, not %u\n", blkNo, slotNo, pBloc->m_Alloc[slotNo]+1, nSize) ;
** threadLog("Bad string address %u:%u (nocalls %u)\n", (strAddr&0x7fff0000)>>16, strAddr&0xffff, _noCalls) ;
** threadLog("Str value approx is [%s]\n", pItem->m_data + 3) ;
** return E_CORRUPT ;
** }
** */
if (_hzGlobal_MT)
m_lockItem[nUnit-1].LockWrite();
pSlot->m_Blank[0]= 0xff;
pSlot->m_fleNext = m_flistItem[nUnit-1];
m_flistItem[nUnit-1]= strAddr ;
m_flistPopl[nUnit-1]++;
m_nReleases++ ;
if (_hzGlobal_MT)
m_lockItem[nUnit-1].Unlock();
return E_OK ;
}