MMgr v2.3.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 tests 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. Quiet is 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 a caller can still call mmgr_movable_buf_move. The member thread_id badges a pass that names no owner. The member thread_yield runs between a sort's moves, with the cellblock open.
thread_wait answers EMBED_FALSE to end the mover. The member thread_moving, where set, hears as each sort's moves start and end. A mover at low priority can then raise itself across the copies a reader may wait on.

Definition at line 701 of file locus_carcerum.h.

Field Documentation

◆ storage

void* const CarcerMovableInitCfg::storage

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

Definition at line 703 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 704 of file locus_carcerum.h.

◆ cells

const size_t CarcerMovableInitCfg::cells

Movable cells the table can name at once.

Definition at line 705 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 706 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 707 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 708 of file locus_carcerum.h.

◆ thread_id

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

The id of the thread that calls, for a pass that names no owner.

Definition at line 709 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 710 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 711 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 712 of file locus_carcerum.h.


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