#include <virtmem.h>
Collaboration diagram for Virtual_memory:
Public Methods | |
void | init () |
void * | alloc (unsigned int request_size) |
void | free (void *data_address) |
Public Attributes | |
void * | managed_mem_start |
Protected Attributes | |
Chunk * | curr_free_chunk |
Chunk * | free_list_head |
Chunk * | free_list_tail |
Some ideas are borrowed from malloc_chunk in Doug Lea's malloc implementation, but significiant design differences are necessary due to the persistent nature of the virtual memory space. (You can't just go around accessing swapped-out pages left and right. Well, you can, but it'd be really slow.)
|
Allocate some virtual memory of the given size in bytes and return it.
|
|
Free some virtual memory previously allocated by alloc().
|
|
Initialize the free list of virtual memory.
|
|
current chunk of free list.
|
|
points to first chunk in free list.
|
|
points to last chunk in free list.
|
|
start of managed memory chunks.
|
Torsion Operating System, Copyright (C) 2000-2002 Dan Helfman