loxbudget

May this operation run right now, and how? A small, heap-free C99 library that answers deterministically — based on resource budgets, rate windows and optional calibration.

MIT licenseC99No heap · no floatsSemver since v1.0.0
Overview

A pre-flight gate in front of risky firmware work

MQTT publish, OTA update, flash write, log burst, debug dump, parser invocation, queue allocation — any operation that must be degraded, delayed, rejected or allowed under pressure gets a deterministic answer before it runs.

check / enter / leave

Deterministic decisions per operation profile.

Caller-owned state

No heap, no floats, no global mutable state.

Audit ring buffer

Optional record of recent decisions.

Rate windows

Optional rate windows and lifetime limits — e.g. flash-write lifetime budgets.

Calibration

Optional calibration and diagnostic strings.

Single header

Single-header amalgamated distribution option; stable public API since v1.0.0.

What loxbudget is not

Not a scheduler, allocator, watchdog, logger, profiler or RTOS replacement. Its value is narrower: an admission-control layer that prevents MQTT storms, blocks OTA on unsafe voltage, degrades logging under memory pressure, and rejects non-critical work in survival mode.

Next in the family loxc — trainable C99 text codec →