Return Type | Function name | Arguments |
---|---|---|
void | hzString::Clear | (void) |
Declared in file: hzString.h
Defined in file : hzString.cpp
Function Logic:
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; } }