#include <virtmem.h>
Collaboration diagram for Virtual_memory:

Public Member Functions | |
| void | init (unsigned &last_available_address) |
| void * | alloc (Size request_size) |
| void * | resize (void *memory, Size new_size) |
| void | free (void *memory) |
| void | enable () |
| bool | is_enabled () |
| bool | manages (void *virtual_page) |
| void | print () |
Static Public Member Functions | |
| Virtual_memory * | create (unsigned &last_available_address, bool map_memory=false) |
Public Attributes | |
| Page_allocator | virtual_pages |
Protected Attributes | |
| Slab_allocator | allocators [PAGE_ALIGNMENT] |
| bool | enabled |
Static Protected Attributes | |
| const unsigned | MAX_PAGE_SPAN_ALIGNMENT = 16 |
The original slab allocator code was generously contributed by Lee Salzman. There is one slab allocator for each power-of-two object size up to PAGE_SIZE.
|
|
Allocate some virtual memory of the given size in bytes and return it.
|
|
||||||||||||
|
Create a Virtual_memory allocator object below the given address and return a pointer to the new object. If map_memory is true then this new allocator will be mapped into physical memory, and init() should be be called on it before use. If map_memory is false, then this allocator will be brought in from disk and then immediately enabled. |
|
|
Enable the virtual memory and allow allocation.
|
|
|
Free some virtual memory previously allocated by alloc().
|
|
|
Initialize the virtual memory allocator.
|
|
|
Return whether virtual memory is active.
|
|
|
Return whether this virtual memory allocator manages the given page.
|
|
|
Print basic information on the virtual memory allocator.
|
|
||||||||||||
|
Resize some existing allocated memory to a new size.
|
|
|
managed slab allocators
|
|
|
whether virtual memory is active
|
|
|
largest possible page span is PAGE_SIZE * 2^MAX_PAGE_SPAN_ALIGNMENT bytes
|
|
|
page allocator for virtual memory
|
Torsion Operating System, Copyright (C) 2000-2004 Dan Helfman