15 #ifndef SIMPLEALLOCATOR_H 16 #define SIMPLEALLOCATOR_H 18 #include "pandabase.h" 19 #include "linkedListNode.h" 21 #include "mutexHolder.h" 36 virtual ~SimpleAllocator();
40 INLINE
bool is_empty()
const;
41 INLINE
size_t get_total_size()
const;
42 INLINE
size_t get_max_size()
const;
43 INLINE
void set_max_size(
size_t max_size);
44 INLINE
size_t get_contiguous()
const;
48 void output(ostream &out)
const;
49 void write(ostream &out)
const;
53 INLINE
bool do_is_empty()
const;
57 virtual void changed_contiguous();
98 size_t start,
size_t size);
101 INLINE ~SimpleAllocatorBlock();
106 INLINE
size_t get_start()
const;
107 INLINE
size_t get_size()
const;
108 INLINE
bool is_free()
const;
110 INLINE
size_t get_max_size()
const;
111 INLINE
bool realloc(
size_t size);
113 INLINE SimpleAllocatorBlock *get_next_block()
const;
115 void output(ostream &out)
const;
118 INLINE
void do_free();
119 INLINE
size_t do_get_max_size()
const;
120 INLINE
bool do_realloc(
size_t size);
130 INLINE ostream &operator << (ostream &out,
const SimpleAllocator &obj) {
140 #include "simpleAllocator.I" An implementation of a very simple block allocator.
A standard mutex, or mutual exclusion lock.
This just stores the pointers to implement a doubly-linked list of some kind of object.
A single block as returned from SimpleAllocator::alloc().