fixed heap corruption

improved memory usage
removed useless stringpooler
This commit is contained in:
David Anderson
2006-06-04 19:26:43 +00:00
parent cef005317b
commit 24cdcde968
6 changed files with 76 additions and 232 deletions

View File

@ -14,32 +14,6 @@ struct QueuedResultInfo
bool query_success;
};
typedef int stridx_t;
class StringPool
{
public:
StringPool();
~StringPool();
void SetMutex(IMutex *m);
void UnsetMutex();
bool IsThreadable();
public:
stridx_t MakeString(const char *str);
void FreeString(stridx_t idx);
const char *GetString(stridx_t idx);
void StartHardLock();
void StopHardLock();
public:
static const int NullString = -1;
private:
CStack<stridx_t> m_FreeStrings;
CVector<stridx_t> m_UseTable;
CVector<SourceHook::String *> m_Strings;
IMutex *m_mutex;
bool m_stoplock;
};
class AtomicResult :
public IResultSet,
public IResultRow
@ -73,10 +47,8 @@ private:
private:
unsigned int m_RowCount;
unsigned int m_FieldCount;
unsigned int m_AllocFields;
unsigned int m_AllocRows;
stridx_t *m_Fields;
stridx_t **m_Rows;
size_t m_AllocSize;
SourceHook::String **m_Table;
unsigned int m_CurRow;
bool m_IsFree;
};