2 * Copyright 2007, Hugo Santos. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Hugo Santos, hugosantos@gmail.com
14 #include <slab/Slab.h>
17 static const size_t kMinObjectAlignment
= 8;
20 void request_memory_manager_maintenance();
22 void* block_alloc(size_t size
, size_t alignment
, uint32 flags
);
23 void* block_alloc_early(size_t size
);
24 void block_free(void* block
, uint32 flags
);
25 void block_allocator_init_boot();
26 void block_allocator_init_rest();
29 template<typename Type
>
39 template<typename Type
>
41 _push(Type
*& head
, Type
* object
)
49 slab_internal_alloc(size_t size
, uint32 flags
)
51 if (flags
& CACHE_DURING_BOOT
)
52 return block_alloc_early(size
);
54 return block_alloc(size
, 0, flags
);
59 slab_internal_free(void* buffer
, uint32 flags
)
61 block_free(buffer
, flags
);
65 #endif // SLAB_PRIVATE_H