Go to the source code of this file.
Data Structures | |
struct | memblock |
Defines | |
#define | roundew(x) (void *)( (3 + (ulong)(x)) & ~0x03 ) |
#define | truncew(x) (void *)( ((ulong)(x)) & ~0x03 ) |
#define | roundmb(x) (void *)( (7 + (ulong)(x)) & ~0x07 ) |
#define | truncmb(x) (void *)( ((ulong)(x)) & ~0x07 ) |
Functions | |
syscall | freemem (void *pmem) |
void * | getmem (ulong nbytes) |
Variables | |
struct memblock | freelist |
void * | minheap |
void * | end |
Definition in file memory.h.
#define roundew | ( | x | ) | (void *)( (3 + (ulong)(x)) & ~0x03 ) |
#define roundmb | ( | x | ) | (void *)( (7 + (ulong)(x)) & ~0x07 ) |
#define truncew | ( | x | ) | (void *)( ((ulong)(x)) & ~0x03 ) |
syscall freemem | ( | void * | pmem | ) |
Free a memory block, returning it to free list.
*pmem | pointer to memory block |
Definition at line 20 of file freemem.c.
References ASSERT, disable(), freelist, memblock::length, minheap, memblock::next, NULL, OK, restore(), and SYSERR.
Referenced by kill().
void* getmem | ( | ulong | nbytes | ) |
Allocate heap storage, returning pointer to assigned memory region.
nbytes | number of bytes requested |
Definition at line 17 of file getmem.c.
References disable(), freelist, memblock::length, memblock::next, NULL, restore(), roundmb, and SYSERR.
Referenced by create().
void* end |
linker provides end of image
Referenced by getstk(), nulluser(), sysinit(), and xsh_memstat().
head of free memory list
Definition at line 42 of file initialize.c.
Referenced by freemem(), getmem(), sysinit(), and xsh_memstat().
void* minheap |
bottom of heap
Definition at line 49 of file initialize.c.
Referenced by freemem(), nulluser(), and sysinit().