WKern
Loading...
Searching...
No Matches
kmem.h File Reference
#include <types/nums.h>

Go to the source code of this file.

Functions

int Kmemcmp (const void *a, const void *b, size_t n)
 Compare memory.
void * Kmemcpy (void *dest, const void *src, unsigned int count)
 Copy memory.
void Kmemset (void *ptr, unsigned char value, unsigned int num)
 Set memory to a value.
void * Kmalloc (size_t size, size_t align)
 Allocate memory.
void KheapInit ()
 Initialize Memory Heap.
void Kfree (void *ptr)
 Free allocated memory.

Function Documentation

◆ Kfree()

void Kfree ( void * ptr)

Free allocated memory.

Parameters
voifd*- Pointer to allocated memory (from Kmalloc)

Definition at line 75 of file alloc.c.

◆ KheapInit()

void KheapInit ( )

Initialize Memory Heap.

Definition at line 35 of file alloc.c.

◆ Kmalloc()

void * Kmalloc ( size_t size,
size_t align )

Allocate memory.

Parameters
Size- Size of memory to allocate
Align- Which to align memory to
Returns
Pointer to allocated memory

Definition at line 48 of file alloc.c.

◆ Kmemcmp()

int Kmemcmp ( const void * a,
const void * b,
size_t n )

Compare memory.

Compares the first n bytes of two memory areas.

Parameters
aPointer to the first memory area.
bPointer to the second memory area.
nNumber of bytes to compare.
Returns
An integer less than, equal to, or greater than zero if the first differing byte in a is found to be less than, equal to, or greater than the corresponding byte in b. Returns 0 if all n bytes are equal.

Definition at line 59 of file memutil.c.

◆ Kmemcpy()

void * Kmemcpy ( void * dest,
const void * src,
unsigned int count )

Copy memory.

Parameters
void*dest - Pointer to memory destination
void*src - Pointer to source memory
u32count - Amount of bytes to be copied

Definition at line 38 of file memutil.c.

◆ Kmemset()

void Kmemset ( void * ptr,
unsigned char value,
unsigned int num )

Set memory to a value.

Parameters
void*ptr - Pointer to memory which is to be modified
u8value - Value to set memory too
u32num - Number of bytes to set

Definition at line 26 of file memutil.c.