mirror of https://github.com/PrimeDecomp/prime.git
Initial CMediumAllocPool, rstl::list fixes
Former-commit-id: bda8099994
This commit is contained in:
parent
d95a2b6b7a
commit
5349fcf3e9
|
@ -655,7 +655,7 @@ LIBS = [
|
|||
["Kyoto/Input/DolphinIController", True],
|
||||
["Kyoto/Input/CDolphinController", True],
|
||||
["Kyoto/DolphinCDvdFile", False],
|
||||
"Kyoto/Alloc/CMediumAllocPool",
|
||||
["Kyoto/Alloc/CMediumAllocPool", False],
|
||||
["Kyoto/Alloc/CSmallAllocPool", True],
|
||||
["Kyoto/Alloc/CGameAllocator", False],
|
||||
"Kyoto/Animation/DolphinCSkinnedModel",
|
||||
|
|
|
@ -17,8 +17,8 @@ public:
|
|||
};
|
||||
|
||||
rstl::list< SMediumAllocPuddle > x0_list;
|
||||
/*rstl::list_node<SMediumAllocPuddle>* x18_lastNodePrev; */
|
||||
void* x18_lastNodePrev;
|
||||
const rstl::list< SMediumAllocPuddle >::node* x18_lastNodePrev;
|
||||
CMediumAllocPool();
|
||||
void* Alloc(uint size);
|
||||
bool HasPuddles() const;
|
||||
void AddPuddle(uint, void*, int);
|
||||
|
@ -29,6 +29,8 @@ public:
|
|||
uint GetTotalEntries();
|
||||
uint GetNumBlocksAvailable();
|
||||
uint GetNumAllocs();
|
||||
|
||||
static CMediumAllocPool* gMediumAllocPtr;
|
||||
};
|
||||
|
||||
#endif // _CMEDIUMALLOCPOOL
|
||||
|
|
|
@ -51,7 +51,6 @@ public:
|
|||
return iterator(it);
|
||||
}
|
||||
|
||||
private:
|
||||
struct node {
|
||||
node* x0_prev;
|
||||
node* x4_next;
|
||||
|
@ -92,7 +91,7 @@ public:
|
|||
typedef T* value_type;
|
||||
|
||||
const_iterator() : current(nullptr) {}
|
||||
const_iterator(const node* begin) : current(begin) {}
|
||||
const_iterator(node* begin) : current(begin) {}
|
||||
const_iterator& operator++() {
|
||||
this->current = this->current->x4_next;
|
||||
return *this;
|
||||
|
@ -109,13 +108,13 @@ public:
|
|||
bool operator==(const const_iterator& other) const { return current == other.current; }
|
||||
bool operator!=(const const_iterator& other) const { return current != other.current; }
|
||||
|
||||
const node* get_node() const { return current; }
|
||||
node* get_node() const { return current; }
|
||||
|
||||
protected:
|
||||
const node* current;
|
||||
node* current;
|
||||
};
|
||||
|
||||
class iterator : const_iterator {
|
||||
class iterator : public const_iterator {
|
||||
public:
|
||||
typedef T* value_type;
|
||||
|
||||
|
@ -140,14 +139,9 @@ public:
|
|||
T* operator->() const { return current->get_value(); }
|
||||
bool operator==(const iterator& other) const { return current == other.current; }
|
||||
bool operator!=(const iterator& other) const { return current != other.current; }
|
||||
|
||||
node* get_node() const { return current; }
|
||||
|
||||
protected:
|
||||
node* current;
|
||||
};
|
||||
|
||||
private:
|
||||
public:
|
||||
Alloc x0_allocator;
|
||||
node* x4_start;
|
||||
node* x8_end;
|
||||
|
|
Loading…
Reference in New Issue