22#ifndef PROTOCORE_GUARDRAILS_H
23#define PROTOCORE_GUARDRAILS_H
27#if PROTOCORE_ENABLE_GUARDRAILS
35 uint32_t min_free_heap;
36 uint32_t largest_free_block;
42#define PROTOCORE_BREACH_NONE 0
43#define PROTOCORE_BREACH_HEAP 1
44#define PROTOCORE_BREACH_FRAG 2
45#define PROTOCORE_BREACH_STACK 4
48typedef void (*protocore_breach_fn)(uint8_t breaches,
const protocore_health *h);
54 uint32_t frag_min_block;
85 protocore_health *health;
86 GuardrailFloorArgs floors;
88 protocore_breach_fn cb;
94extern GuardrailsVars GuardrailsV;
99 void (*
const eval)(uint8_t *work);
100 void (*
const json)(uint8_t *work);
101 void (*
const sample)(uint8_t *work);
102 void (*
const begin)(uint8_t *work);
103 void (*
const check)(uint8_t *work);
108void protocore_guardrails_eval(uint8_t *work);
109void protocore_guardrails_json(uint8_t *work);
110void protocore_guardrails_sample(uint8_t *work);
111void protocore_guardrails_begin(uint8_t *work);
112void protocore_guardrails_check(uint8_t *work);
118static const GuardrailsNs Guardrails __attribute__((unused)) = {
119 .eval = protocore_guardrails_eval,
120 .json = protocore_guardrails_json,
121 .sample = protocore_guardrails_sample,
122 .begin = protocore_guardrails_begin,
123 .check = protocore_guardrails_check,
135uint8_t *protocore_guardrails_span(
void);
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
#define PROTOCORE_END_DECLS