MMgr v1.0.0
Zero-heap memory manager in C11. One borrowed buffer, carved by asserted offset.
Loading...
Searching...
No Matches
proximus_operor.h File Reference

Typed loads and stores, and the proxim dispatch table. More...

#include "mmgr.h"

Go to the source code of this file.

Data Structures

struct  ProximusCfg
 Arguments for the proxim calls. More...
struct  ProximusOperorNs
 Type of the proxim dispatch table. More...

Functions

uint16_t mmgr_proxim_load16 (const ProximusCfg *args)
 Reads two bytes from args->at in the target's own order.
uint32_t mmgr_proxim_load32 (const ProximusCfg *args)
 Reads four bytes from args->at in the target's own order.
uint64_t mmgr_proxim_load64 (const ProximusCfg *args)
 Reads eight bytes from args->at in the target's own order.
void mmgr_proxim_put16 (const ProximusCfg *args)
 Writes the low two bytes of args->val to args->dst in the target's own order.
void mmgr_proxim_put32 (const ProximusCfg *args)
 Writes the low four bytes of args->val to args->dst in the target's own order.
void mmgr_proxim_put64 (const ProximusCfg *args)
 Writes all eight bytes of args->val to args->dst in the target's own order.
embed_word mmgr_proxim_load (const ProximusCfg *args)
 Reads one word from args->at in the target's own order.
void mmgr_proxim_put (const ProximusCfg *args)
 Writes the low word of args->val to args->dst in the target's own order.
embed_word mmgr_aequus_load (const ProximusCfg *args)
 Reads one word from an aligned args->at, in the target's own order.
void mmgr_aequus_put (const ProximusCfg *args)
 Writes the low word of args->val to an aligned args->dst.
uint64_t mmgr_aequus_load64 (const ProximusCfg *args)
 Reads eight bytes from an aligned args->at, in the target's own order.
void mmgr_aequus_put64 (const ProximusCfg *args)
 Writes all eight bytes of args->val to an aligned args->dst.
void mmgr_proxim_read (const ProximusCfg *args)
 Copies args->size bytes from args->at to args->dst.

Variables

static const ProximusOperorNs proxim
 Dispatch table instance named proxim.

Detailed Description

Typed loads and stores, and the proxim dispatch table.

Author
dstroy0 (Douglas Quigg) dquig.nosp@m.g123.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
Date
2026-08-29
Note
load16 through put64, load, put and read take any address.
The four al_ entries need an address aligned for the type they carry.

Definition in file proximus_operor.h.

Function Documentation

◆ mmgr_proxim_load16()

uint16_t mmgr_proxim_load16 ( const ProximusCfg * args)

Reads two bytes from args->at in the target's own order.

Parameters
[in]argsAddress to read from [BORROWS].
Returns
The two bytes as a uint16_t.
Warning
args->at must be readable for two bytes, at any alignment.

References mmgr_proxim_load16().

Referenced by mmgr_proxim_load16().

◆ mmgr_proxim_load32()

uint32_t mmgr_proxim_load32 ( const ProximusCfg * args)

Reads four bytes from args->at in the target's own order.

Parameters
[in]argsAddress to read from [BORROWS].
Returns
The four bytes as a uint32_t.
Warning
args->at must be readable for four bytes, at any alignment.

References mmgr_proxim_load32().

Referenced by mmgr_proxim_load32().

◆ mmgr_proxim_load64()

uint64_t mmgr_proxim_load64 ( const ProximusCfg * args)

Reads eight bytes from args->at in the target's own order.

Parameters
[in]argsAddress to read from [BORROWS].
Returns
The eight bytes as a uint64_t.
Warning
args->at must be readable for eight bytes, at any alignment.

References mmgr_proxim_load64().

Referenced by mmgr_proxim_load64().

◆ mmgr_proxim_put16()

void mmgr_proxim_put16 ( const ProximusCfg * args)

Writes the low two bytes of args->val to args->dst in the target's own order.

Parameters
[in]argsDestination and value [BORROWS].
Note
The upper six bytes of args->val take no part.
Warning
args->dst must be writable for two bytes, at any alignment.

References mmgr_proxim_put16().

Referenced by mmgr_proxim_put16().

◆ mmgr_proxim_put32()

void mmgr_proxim_put32 ( const ProximusCfg * args)

Writes the low four bytes of args->val to args->dst in the target's own order.

Parameters
[in]argsDestination and value [BORROWS].
Note
The upper four bytes of args->val take no part.
Warning
args->dst must be writable for four bytes, at any alignment.

References mmgr_proxim_put32().

Referenced by mmgr_proxim_put32().

◆ mmgr_proxim_put64()

void mmgr_proxim_put64 ( const ProximusCfg * args)

Writes all eight bytes of args->val to args->dst in the target's own order.

Parameters
[in]argsDestination and value [BORROWS].
Warning
args->dst must be writable for eight bytes, at any alignment.

References mmgr_proxim_put64().

Referenced by mmgr_proxim_put64().

◆ mmgr_proxim_load()

embed_word mmgr_proxim_load ( const ProximusCfg * args)

Reads one word from args->at in the target's own order.

Parameters
[in]argsAddress to read from [BORROWS].
Returns
The bytes as an embed_word.
Warning
args->at must be readable for a whole embed_word, at any alignment.

References mmgr_proxim_load().

Referenced by mmgr_proxim_load().

◆ mmgr_proxim_put()

void mmgr_proxim_put ( const ProximusCfg * args)

Writes the low word of args->val to args->dst in the target's own order.

Parameters
[in]argsDestination and value [BORROWS].
Warning
args->dst must be writable for a whole embed_word, at any alignment.

References mmgr_proxim_put().

Referenced by mmgr_proxim_put().

◆ mmgr_aequus_load()

embed_word mmgr_aequus_load ( const ProximusCfg * args)

Reads one word from an aligned args->at, in the target's own order.

Parameters
[in]argsAddress to read from [BORROWS].
Returns
The bytes as an embed_word.
Note
Reaches the same bytes as mmgr_proxim_load, through a type that keeps embed_word's alignment.
Warning
args->at must be readable for a whole embed_word and aligned for one.

References mmgr_aequus_load().

Referenced by mmgr_aequus_load().

◆ mmgr_aequus_put()

void mmgr_aequus_put ( const ProximusCfg * args)

Writes the low word of args->val to an aligned args->dst.

Parameters
[in]argsDestination and value [BORROWS].
Note
Reaches the same bytes as mmgr_proxim_put, through a type that keeps embed_word's alignment.
Warning
args->dst must be writable for a whole embed_word and aligned for one.

References mmgr_aequus_put().

Referenced by mmgr_aequus_put().

◆ mmgr_aequus_load64()

uint64_t mmgr_aequus_load64 ( const ProximusCfg * args)

Reads eight bytes from an aligned args->at, in the target's own order.

Parameters
[in]argsAddress to read from [BORROWS].
Returns
The eight bytes as a uint64_t.
Note
Reaches the same bytes as mmgr_proxim_load64, through a type that keeps uint64_t's alignment.
Warning
args->at must be readable for eight bytes and aligned for a uint64_t.

References mmgr_aequus_load64().

Referenced by mmgr_aequus_load64().

◆ mmgr_aequus_put64()

void mmgr_aequus_put64 ( const ProximusCfg * args)

Writes all eight bytes of args->val to an aligned args->dst.

Parameters
[in]argsDestination and value [BORROWS].
Note
Reaches the same bytes as mmgr_proxim_put64, through a type that keeps uint64_t's alignment.
Warning
args->dst must be writable for eight bytes and aligned for a uint64_t.

References mmgr_aequus_put64().

Referenced by mmgr_aequus_put64().

◆ mmgr_proxim_read()

void mmgr_proxim_read ( const ProximusCfg * args)

Copies args->size bytes from args->at to args->dst.

Parameters
[in]argsDestination, source and count [BORROWS].
Note
Copies bytes until args->dst reaches a word boundary, then whole words, then the odd bytes left.
This is the only entry that reads args->size.
Warning
Copies forward. An args->dst above args->at within one region would read bytes it has already written.

References mmgr_proxim_read().

Referenced by mmgr_proxim_read().

Variable Documentation

◆ proxim

const ProximusOperorNs proxim
static

Dispatch table instance named proxim.

Note
The nine unaligned members call the mmgr_proxim_ functions.
The four al_ members call the mmgr_aequus_ ones.

Definition at line 186 of file proximus_operor.h.