Return TypeFunction nameArguments
voidhzString::Clear(void)

Declared in file: hzString.h
Defined in file : hzString.cpp

Function Logic:

0:START 1:m_addr 2:_strXlate thisCtl _strItem::_getSize nLen 3:!nLen 4:hzexit 5:thisCtl->m_copy==0 6:_strItem::_data printf m_addr 7: No text 8:thisCtl->m_copy&&thisCtl->m_copy<50 9:_hzGlobal_MT 10:__sync_add_and_fetch(&(thisCtl->m_copy),-1)==0 11:_strFree 12:items 13:!thisCtl->m_copy 14:_strFree 15:m_addr 16: No text

Function body:

void hzString::Clear (void)
{
   _hzfunc("hzString::Clear()") ;
   _strItem*   thisCtl ;
   uint32_t    nLen ;
   if (m_addr)
   {
       thisCtl = (_strItem*) _strXlate(m_addr) ;
       nLen = thisCtl->_getSize() ;
       if (!nLen)
           hzexit(E_CORRUPT, "Zero string size %u:%u", (m_addr&0xffff0000)>>16,m_addr&0xffff);
       if (thisCtl->m_copy == 0)
       {
           printf("WARN - Zero copis of string size %u:%u (%s)", (m_addr&0xffff0000)>>16,m_addr&0xffff,thisCtl->_data());
           m_addr = 0;
           return ;
       }
       if (thisCtl->m_copy && thisCtl->m_copy < 50)
       {
           if (_hzGlobal_MT)
           {
               if (__sync_add_and_fetch(&(thisCtl->m_copy), -1)== 0)
                   _strFree(m_addr, nLen) ;
           }
           else
           {
               thisCtl->m_copy-- ;
               if (!thisCtl->m_copy)
                   _strFree(m_addr, nLen) ;
           }
       }
       m_addr = 0;
   }
}