## Problem Currently, stackman provides stack switching but no built-in overflow detection. Users must manually implement guard pages or canaries. ## Proposal Add optional stack overflow detection helpers: 1. **Guard zone utilities**: - `stackman_guard_init(void *stack, size_t size, size_t guard_bytes)` - Initialize guard pattern - `stackman_guard_check(void *stack, size_t size, size_t guard_bytes)` - Verify guard intact 2. **Stack usage tracking**: - `stackman_stack_usage(void *stack_base, size_t size)` - Measure actual usage via stack painting ## Benefits - Easier debugging of stack-related crashes - Production overflow detection - Helps users size stacks appropriately ## Implementation Could be a separate header (`stackman_debug.h`) to keep core library minimal. ## Related test_04 already uses basic guard bytes for validation - could formalize this pattern.
Activity