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

What a program gives a cellblock for the movable option, once, through its guard's movable_init. More...

#include <locus_carcerum.h>

Data Fields

void *const storage
const size_t storage_bytes
const size_t cells
const size_t width
const size_t rows
embed_bool(*const) thread_started (void(*run)(void *context), void *context)
size_t(*const) thread_id (void)
embed_bool(*const) thread_wait (uint32_t milliseconds)
void(*const) thread_yield (void)
void(*const) thread_moving (embed_bool moving)

Detailed Description

What a program gives a cellblock for the movable option, once, through its guard's movable_init.

Note
The option is the program's to choose. A cellblock with none takes and gives as it always does, each entry testing one word, and its movable_buf_alloc answers NULL.
storage holds the table, its claim bits and the rows. It lies outside the prison, and so nothing of the option pins a tier or counts as a cell. A pool declared at compile time gives it a link-time address.
width bounds the lanes the cellblock's turnstiles may have open while the mover reads it quiet: twice the lanes open at or under width plus one, with no pass since the mover's last reading. The system's logical processors bound it: no more contexts than that run at once.
rows are the rows of touches, one a lane and the last for the lanes past them, which mmgr_movable_touches reads.
thread_started and thread_wait together are the mover's thread. With either unset, nothing moves a cell on its own, and mmgr_movable_buf_move remains for a caller to call. thread_id badges a pass that names no owner; thread_yield runs between a sort's moves, with the cellblock open.
thread_wait answers EMBED_FALSE to end the mover. thread_moving, where set, is told as each sort's moves start and end, for a mover at low priority to raise itself across the copies a reader may wait on.

Definition at line 456 of file locus_carcerum.h.

Field Documentation

◆ storage

void* const CarcerMovableInitCfg::storage

Bytes for the option, zero as given [BORROWS].

Definition at line 458 of file locus_carcerum.h.

◆ storage_bytes

const size_t CarcerMovableInitCfg::storage_bytes

Bytes at storage, MMGR_MOVABLE_STORAGE_BYTES at least.

Definition at line 459 of file locus_carcerum.h.

◆ cells

const size_t CarcerMovableInitCfg::cells

Movable cells the table can name at once.

Definition at line 460 of file locus_carcerum.h.

◆ width

const size_t CarcerMovableInitCfg::width

The lanes open bound the mover reads quiet under, one at the fewest.

Definition at line 461 of file locus_carcerum.h.

◆ rows

const size_t CarcerMovableInitCfg::rows

Rows of touches, one a lane, the last shared by the lanes past it.

Definition at line 462 of file locus_carcerum.h.

◆ thread_started

embed_bool(*const) CarcerMovableInitCfg::thread_started(void(*run)(void *context), void *context)

Starts the mover.

Definition at line 463 of file locus_carcerum.h.

◆ thread_id

size_t(*const) CarcerMovableInitCfg::thread_id(void)

The calling thread's id, for a pass naming no owner.

Definition at line 464 of file locus_carcerum.h.

◆ thread_wait

embed_bool(*const) CarcerMovableInitCfg::thread_wait(uint32_t milliseconds)

Sleeps the mover, EMBED_FALSE to end it.

Definition at line 465 of file locus_carcerum.h.

◆ thread_yield

void(*const) CarcerMovableInitCfg::thread_yield(void)

Gives up the processor between a sort's moves, where set.

Definition at line 466 of file locus_carcerum.h.

◆ thread_moving

void(*const) CarcerMovableInitCfg::thread_moving(embed_bool moving)

Told as each move starts and ends, where set.

Definition at line 467 of file locus_carcerum.h.


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