libclod
C library for interacting with NBTs, region files, LOD data and other things.
Loading...
Searching...
No Matches
vm.h File Reference
#include <clod/lib.h>

Go to the source code of this file.

Functions

size_t clod_vm_page_size ()
void * clod_vm_alloc (size_t size)
 Allocate virtual memory.
void clod_vm_free (void *ptr, size_t size)

Detailed Description

Methods relating to system virtual memory. For example, clod/memory.h uses this as a backend for allocation.

Definition in file vm.h.

Function Documentation

◆ clod_vm_page_size()

size_t clod_vm_page_size ( )

Get the system page size. Currently set to 4096 constant as other page sizes are rare, and linux offers no way to query it.

Definition at line 5 of file vm.c.

◆ clod_vm_alloc()

void * clod_vm_alloc ( size_t size)

Allocate virtual memory.

Definition at line 9 of file vm.c.

◆ clod_vm_free()

void clod_vm_free ( void * ptr,
size_t size )

Free virtual memory. Size must be equal to the value passed to clod_vm_alloc.

Definition at line 17 of file vm.c.