Commit fbe5e2fb authored by D-AIRY's avatar D-AIRY

Some bugfix

parent 04794d70
......@@ -329,7 +329,7 @@ public:
{
if(!(memblocks[page].mem[offset].IsFree & 0x80000000))
{
return(memblocks[page].mem[offset].data);
return(&memblocks[page].mem[offset].data);
}
return(NULL);
}
......
......@@ -27,7 +27,7 @@ class Stack
struct StackNode
{
T data;
StackNode * Parent;
StackNode *Parent;
};
MemAlloc<StackNode, pageSize, 16, alignBy> Data;
......@@ -122,21 +122,22 @@ public:
return(Data.GetAt(page, pageOffset));
}
T get(int id)
T& get(int id)
{
if(id < 0)
{
id += this->SP;
}
--id;
if(id < 0 || id >= this->SP)
//--id;
assert(id >= 0 && id < SP);
/*if(id < 0 || id >= this->SP)
{
return(NULL);
}
}*/
int page = id / pageSize;
int pageOffset = id % pageSize;
return(*Data.GetAt(page, pageOffset));
return(Data.GetAt(page, pageOffset)->data);
}
inline int count()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment