OurOS 0.1
Operating System built by McGill Students
 
Loading...
Searching...
No Matches
vmalloc.h File Reference
#include <stddef.h>

Go to the source code of this file.

Macros

#define VMALLOC_SIZE   (PAGE_SIZE * 512)
 Maximum size of the virtual memory region for vmalloc.
 
#define VMALLOC_ALIGNMENT   16
 Alignment for each vmalloc allocation.
 

Functions

void vmalloc_init (void)
 Initializes the virtual memory allocator. This should be called after frame allocator and paging are initialized.
 
void * vmalloc (size_t size)
 Allocates size bytes of virtual memory and returns a pointer to it. The allocation is aligned to VMALLOC_ALIGNMENT. It panics if out of memory.
 
void vfree (void *addr)
 Frees the virtual memory allocated at addr. (TODO: stop using bump allocator)
 

Macro Definition Documentation

◆ VMALLOC_ALIGNMENT

#define VMALLOC_ALIGNMENT   16

Alignment for each vmalloc allocation.

◆ VMALLOC_SIZE

#define VMALLOC_SIZE   (PAGE_SIZE * 512)

Maximum size of the virtual memory region for vmalloc.

Function Documentation

◆ vfree()

void vfree ( void *  addr)

Frees the virtual memory allocated at addr. (TODO: stop using bump allocator)

◆ vmalloc()

void * vmalloc ( size_t  size)

Allocates size bytes of virtual memory and returns a pointer to it. The allocation is aligned to VMALLOC_ALIGNMENT. It panics if out of memory.

◆ vmalloc_init()

void vmalloc_init ( void  )

Initializes the virtual memory allocator. This should be called after frame allocator and paging are initialized.