docs: add read only data handling to programming rules

Signed-off-by: Ronald Caesar <github43132@proton.me>
This commit is contained in:
Ronald Caesar
2026-01-13 21:18:50 -04:00
parent 99f4afb9fc
commit f910745a55

View File

@@ -103,3 +103,9 @@ for (int i = 0; i < 100; ++i) {
*cursor++ = ...; // Simple increment.
}
```
## Rule 3: Constants/Read-Only Data
Access these values directly, like `context->max_buffer_size` or
`context->exception_level`. If we never write to it, the compiler knows it
will not change. It will load once and get cached automatically.