Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
sapi_safe_ptr_t Struct Reference

A bounds-checked, canary-protected wrapper around one raw memory region. Opaque to callers in spirit (every field is manipulated only through the functions below) but a plain struct, not a handle, so it can be embedded directly in a caller's own statically-allocated storage - no dynamic allocation, matching CLAUDE.md. More...

#include <sapi_safe_ptr.h>

Data Fields

void * ptr
size_t size
uint32_t canary

Detailed Description

A bounds-checked, canary-protected wrapper around one raw memory region. Opaque to callers in spirit (every field is manipulated only through the functions below) but a plain struct, not a handle, so it can be embedded directly in a caller's own statically-allocated storage - no dynamic allocation, matching CLAUDE.md.

Definition at line 54 of file sapi_safe_ptr.h.

Field Documentation

◆ ptr

void* sapi_safe_ptr_t::ptr

Wrapped pointer; NULL once invalidated.

Definition at line 56 of file sapi_safe_ptr.h.

◆ size

size_t sapi_safe_ptr_t::size

Size in bytes of the region ptr points to.

Definition at line 57 of file sapi_safe_ptr.h.

◆ canary

uint32_t sapi_safe_ptr_t::canary

Corruption check, written by init, cleared by invalidate.

Definition at line 58 of file sapi_safe_ptr.h.


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