GATE
Loading...
Searching...
No Matches
Mem Struct Reference

Generic memory allocation functions. More...

#include <memalloc.hpp>

Static Public Member Functions

static void * alloc (size_t sz) noexcept
 
static void * realloc (void *ptr, size_t newsz) noexcept
 
static void dealloc (void *ptr) noexcept
 
static void * copy (void *dst, void const *src, size_t sz) noexcept
 
static void * move (void *dst, void const *src, size_t sz) noexcept
 
static void clear (void *ptr, size_t size) noexcept
 
static void fill (void *ptr, char chr, size_t count) noexcept
 
static intptr_t compare (void const *ptr1, void const *ptr2, size_t sz) noexcept
 
static void reverse (void *ptr, size_t sz) noexcept
 
static void * copyReverse (void *dst, void const *src, size_t sz) noexcept
 

Detailed Description

Generic memory allocation functions.

Member Function Documentation

◆ alloc()

void * alloc ( size_t sz)
staticnoexcept

Allocates the given amount of bytes from process heap

◆ realloc()

void * realloc ( void * ptr,
size_t newsz )
staticnoexcept

Reallocates a memory block to the given amount of bytes

◆ dealloc()

void dealloc ( void * ptr)
staticnoexcept

Deallocates a memory block from process heap

◆ copy()

void * copy ( void * dst,
void const * src,
size_t sz )
staticnoexcept

Copies a block of memory from a source to a destination address

◆ move()

void * move ( void * dst,
void const * src,
size_t sz )
staticnoexcept

Copies a block of memory by handling overlapping areas

◆ clear()

void clear ( void * ptr,
size_t size )
staticnoexcept

Clears all bits a given range of memory (overwrites with zero)

◆ fill()

void fill ( void * ptr,
char chr,
size_t count )
staticnoexcept

Fills all bytes in a given range of memory with a specific char value

◆ compare()

intptr_t compare ( void const * ptr1,
void const * ptr2,
size_t sz )
staticnoexcept

Compares two memory blocks and returns: -1 if first is small, +1 if second is small, 0 if both are equal

◆ reverse()

void reverse ( void * ptr,
size_t sz )
staticnoexcept

Reverses all bytes in a memory block, [1,2,3] -> [3,2,1]

◆ copyReverse()

void * copyReverse ( void * dst,
void const * src,
size_t sz )
staticnoexcept

Copies bytes from source to destination buffer in reverse order (dst first byte == src last byte)


The documentation for this struct was generated from the following files: