32 #ifndef _INCLUDE_SOURCEMOD_CORE_STRINGTABLE_H_
33 #define _INCLUDE_SOURCEMOD_CORE_STRINGTABLE_H_
43 membase = (
unsigned char *)malloc(init_size);
62 while (tail + addsize >= size) {
64 membase = (
unsigned char *)realloc(membase, size);
69 *addr = (
void *)&membase[idx];
80 if (index < 0 || (
unsigned int)index >= tail)
82 return &membase[index];
95 inline unsigned int GetMemUsage()
100 inline unsigned int GetActualMemUsed()
106 unsigned char *membase;
123 return AddString(
string, strlen(
string));
131 size_t len = length + 1;
135 idx = m_table.
CreateMem(len, (
void **)&addr);
136 memcpy(addr,
string, length + 1);
169 #endif //_INCLUDE_SOURCEMOD_CORE_STRINGTABLE_H_
void * GetAddress(int index)
Definition: sm_memtable.h:78
BaseMemTable * GetMemTable()
Definition: sm_memtable.h:161
void Reset()
Definition: sm_memtable.h:90
Definition: sm_memtable.h:38
void Reset()
Definition: sm_memtable.h:153
Definition: sm_memtable.h:111
int AddString(const char *string)
Definition: sm_memtable.h:121
const char * GetString(int str)
Definition: sm_memtable.h:143
int AddString(const char *string, size_t length)
Definition: sm_memtable.h:129
int CreateMem(unsigned int addsize, void **addr)
Definition: sm_memtable.h:58