DeterministicESPAsyncWebServer v6.28.0
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
guardrails.h File Reference

Runtime heap/stack guardrails (DETWS_ENABLE_GUARDRAILS). More...

#include "ServerConfig.h"
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Detailed Description

Runtime heap/stack guardrails (DETWS_ENABLE_GUARDRAILS).

Samples the live health of the device - free heap, the heap low-water mark, the largest free block (a fragmentation signal), and the calling task's remaining stack - and trips a guardrail (callback) when any value crosses its configured floor. A proactive fail-safe hook on top of the passive numbers in /metrics: an app can shed load, drop to a safe state, or reboot before exhaustion bites.

The threshold evaluator and the JSON serializer are pure and host-tested; the sample reads esp_get_free_heap_size / heap_caps_get_largest_free_block / uxTaskGetStackHighWaterMark on ESP32 (zeros on host).

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file guardrails.h.