Fixed silly crash bugs
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40209
This commit is contained in:
parent
a1e58aa9ef
commit
1ffa6eac9f
@ -6,6 +6,7 @@ BaseMemTable::BaseMemTable(unsigned int init_size)
|
|||||||
{
|
{
|
||||||
membase = (unsigned char *)malloc(init_size);
|
membase = (unsigned char *)malloc(init_size);
|
||||||
size = init_size;
|
size = init_size;
|
||||||
|
tail = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseMemTable::~BaseMemTable()
|
BaseMemTable::~BaseMemTable()
|
||||||
@ -18,11 +19,6 @@ int BaseMemTable::CreateMem(unsigned int addsize, void **addr)
|
|||||||
{
|
{
|
||||||
int idx = (int)tail;
|
int idx = (int)tail;
|
||||||
|
|
||||||
if (idx < 0)
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (tail + addsize >= size)
|
while (tail + addsize >= size)
|
||||||
{
|
{
|
||||||
size *= 2;
|
size *= 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user