|
XenevaOS
|

Macros | |
| #define | LIBALLOC_MAGIC 0xc001c0de |
| #define | MAXCOMPLETE 5 |
| #define | MAXEXP 32 |
| #define | MINEXP 8 |
| #define | MODE_BEST 0 |
| #define | MODE_INSTANT 1 |
| #define | MODE MODE_BEST |
Functions | |
| void * | malloc (unsigned int size) |
| void | free (void *ptr) |
| void * | calloc (unsigned long long nobj, unsigned long long size) |
| void * | realloc (void *p, unsigned int size) |
| int | liballoc_lock () |
| int | liballoc_unlock () |
| void * | liballoc_alloc (int pages) |
| int | liballoc_free (void *ptr, int pages) |
| void | heap_initialize_allocator () |
Variables | |
| struct boundary_tag * | l_freePages [MAXEXP] |
| int | l_completePages [MAXEXP] |
| #define LIBALLOC_MAGIC 0xc001c0de |
Durand's Ridiculously Amazing Super Duper Memory functions.
| #define MAXCOMPLETE 5 |
| #define MAXEXP 32 |
| #define MINEXP 8 |
| #define MODE MODE_BEST |
| #define MODE_BEST 0 |
| #define MODE_INSTANT 1 |
| void * calloc | ( | unsigned long long | nobj, |
| unsigned long long | size | ||
| ) |
| void free | ( | void * | ptr | ) |
| void heap_initialize_allocator | ( | ) |
| void * liballoc_alloc | ( | int | pages | ) |
This is the hook into the local system which allocates pages. It accepts an integer parameter which is the number of pages required. The page size was set up in the liballoc_init function.
| int liballoc_free | ( | void * | ptr, |
| int | pages | ||
| ) |
This frees previously allocated memory. The void* parameter passed to the function is the exact same value returned from a previous liballoc_alloc call.
The integer value is the number of pages to free.
| int liballoc_lock | ( | ) |
This function is supposed to lock the memory data structures. It could be as simple as disabling interrupts or acquiring a spinlock. It's up to you to decide.
| int liballoc_unlock | ( | ) |
This function unlocks what was previously locked by the liballoc_lock function. If it disabled interrupts, it enables interrupts. If it had acquiried a spinlock, it releases the spinlock. etc.
| void * malloc | ( | unsigned int | size | ) |
| void * realloc | ( | void * | p, |
| unsigned int | size | ||
| ) |
| int l_completePages[MAXEXP] |
| struct boundary_tag* l_freePages[MAXEXP] |