Internal Interface: memory management.
More...
#include <config.h>
#include <mem.h>
#include <stdlib.h>
Go to the source code of this file.
Functions |
void | mm_init () |
| initialize memory management
|
void | mm_reaper () |
| free all blocks allocated by the current process
|
int | mm_free_mem (void) |
| how many bytes of memory are free?
|
Detailed Description
Internal Interface: memory management.
- Author
- Markus L. Noga marku.nosp@m.s@no.nosp@m.ga.de
Definition in file mm.h.
Macro Definition Documentation
#define MM_BLOCK_FREE |
( |
|
addr | ) |
|
Value:next=(size_t*)(addr); \
current=next;
memory from addr on can be allocated
Macro for mm_init(). Always alternate MM_BLOCK_FREE and MM_BLOCK_RESERVED.
Definition at line 68 of file mm.h.
#define MM_BLOCK_RESERVED |
( |
|
addr | ) |
|
Value:next=(size_t*)(((size_t)addr)-4); \
current=next;
memory from addr on is reserved
Macro for mm_init(). Always alternate MM_BLOCK_FREE and MM_BLOCK_RESERVED.
Definition at line 79 of file mm.h.
marker: block free
Definition at line 47 of file mm.h.
2 words header: pid, size
Definition at line 53 of file mm.h.
#define MM_RESERVED 0xffff |
marker: block reserved
Definition at line 48 of file mm.h.
split off if 8+ data bytes
Definition at line 54 of file mm.h.
Function Documentation
how many bytes of memory are free?
initialize memory management
Referenced by kmain().
free all blocks allocated by the current process
Variable Documentation
end of kernel code + data