index fbf58fec30e5bf8cb25684d0f3992cc2af5c8fb8..5d3563fbda45710179c828544a95362bab396d68 100644 (file)
*/
class LinkerBlockAllocator {
public:
- LinkerBlockAllocator();
+ explicit LinkerBlockAllocator(size_t block_size);
- void init(size_t block_size);
void* alloc();
void free(void* block);
void protect_all(int prot);
template<typename T>
class LinkerAllocator {
public:
- LinkerAllocator() : block_allocator_() {}
- void init() { block_allocator_.init(sizeof(T)); }
+ LinkerAllocator() : block_allocator_(sizeof(T)) {}
T* alloc() { return reinterpret_cast<T*>(block_allocator_.alloc()); }
void free(T* t) { block_allocator_.free(t); }
void protect_all(int prot) { block_allocator_.protect_all(prot); }