* Instead of a heap class index heap_create_allocator() gets an actual

heap_class object now. Removed unused heap_allocator::heap_class.
* Made heap_class, heap_create_allocator(), heap_memalign(), heap_free()
  public, so that a specialized allocator can be used elsewhere in the
  kernel.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26965 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-08-14 00:40:40 +00:00
parent 38d78c5f83
commit f3e82cfe42
2 changed files with 28 additions and 22 deletions
+19
View File
@@ -20,6 +20,20 @@
#define HEAP_AREA_USE_THRESHOLD 1 * 1024 * 1024
typedef struct heap_class_s {
const char *name;
uint32 initial_percentage;
size_t max_allocation_size;
size_t page_size;
size_t min_bin_size;
size_t bin_alignment;
uint32 min_count_per_page;
size_t max_waste_per_page;
} heap_class;
typedef struct heap_allocator_s heap_allocator;
#ifdef __cplusplus
extern "C" {
#endif
@@ -36,6 +50,11 @@ void* malloc_referenced(size_t size);
void* malloc_referenced_acquire(void* data);
void malloc_referenced_release(void* data);
heap_allocator* heap_create_allocator(const char* name, addr_t base,
size_t size, const heap_class* heapClass);
void* heap_memalign(heap_allocator* heap, size_t alignment, size_t size);
status_t heap_free(heap_allocator* heap, void* address);
status_t heap_init(addr_t heapBase, size_t heapSize);
status_t heap_init_post_sem();
status_t heap_init_post_thread();