set up the new Entries array.
This commit is contained in:
parent
e9700e2771
commit
ae1bd3c890
17 changed files with 346 additions and 49 deletions
|
|
@ -104,10 +104,12 @@ StringPool::Block *StringPool::AddBlock(size_t size)
|
|||
return mem;
|
||||
}
|
||||
|
||||
void *StringPool::iAlloc(size_t size)
|
||||
void *StringPool::Alloc(size_t size)
|
||||
{
|
||||
Block *block;
|
||||
|
||||
size = ((size)+8) & ~7;
|
||||
|
||||
for (block = TopBlock; block != nullptr; block = block->NextBlock)
|
||||
{
|
||||
void *res = block->Alloc(size);
|
||||
|
|
@ -122,7 +124,7 @@ void *StringPool::iAlloc(size_t size)
|
|||
|
||||
const char* StringPool::Strdup(const char* str)
|
||||
{
|
||||
char* p = (char*)iAlloc((strlen(str) + 8) & ~7 );
|
||||
char* p = (char*)Alloc(strlen(str));
|
||||
strcpy(p, str);
|
||||
return p;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue