hollyhock
Loading...
Searching...
No Matches
Macros | Functions | Variables
mem.h File Reference

Functions used for modifying and allocating memory. More...

#include <stdint.h>
#include <stddef.h>
Include dependency graph for mem.h:

Go to the source code of this file.

Macros

#define __UCONCAT(a, b)   #a b
 
#define _UCONCAT(a, b)   __UCONCAT(a, b)
 
#define UCONCAT(b)   _UCONCAT(__USER_LABEL_PREFIX__, b)
 

Functions

static void alloc_size (1)
 
static void assume_aligned (4)
 

Variables

void(* Mem_Free )(void *ptr)
 
void *(* _FP_Mem_Malloc )(size_t size) __asm__(UCONCAT("Mem_Malloc")) __attribute__((alloc_size(1)
 
void *(* warn_unused_result )
 
static void unused
 
void *(* Mem_Memcpy )(void *destination, const void *source, size_t num) __attribute__((access(read_only
 
void *(* access )(write_only, 1, 3)))
 
void *(* Mem_Memset )(void *ptr, int value, size_t num) __attribute__((access(write_only
 

Detailed Description

Functions used for modifying and allocating memory.

Similar to the memory functions provided by the C standard library.

Variable Documentation

◆ Mem_Free

void(* Mem_Free) (void *ptr) ( void *  ptr)
extern

Frees memory allocated by malloc, allowing it to be reused.

Parameters
ptrThe pointer to the allocated region of memory to free.

◆ Mem_Memcpy

void *(* Mem_Memcpy) (void *destination, const void *source, size_t num) __attribute__((access(read_only ( void *  destination,
const void *  source,
size_t  num 
)
extern

Copies one region of memory to another. Equivalent to the C standard library function with the same name.

Copies num bytes from source to destination.

Parameters
[out]destinationA pointer to the destination of the copy.
[in]sourceA pointer to the source for the copy.
numThe number of bytes to copy.
Returns
destination

◆ Mem_Memset

void *(* Mem_Memset) (void *ptr, int value, size_t num) __attribute__((access(write_only ( void *  ptr,
int  value,
size_t  num 
)
extern

Sets a region of memory to a specific value. Equivalent to the C standard library function with the same name.

Fills the region pointed to by ptr with num bytes of value value (zero-extended to a byte).

Parameters
[out]ptrA pointer to the region of memory to fill.
valueThe value to fill the memory region with.
numThe number of bytes to fill.
Returns
ptr