- Strengthened scratchpad bounds validation and ensured pointer range checks.
- Improved memory management with fallback allocation and robust cleanup.
- Adjusted SEADER_UART_RX_BUF_SIZE to 300 for better headroom.
- Added safeguards against frame/header underflows in scratchpad handling.
- Ensured proper alignment for UART worker and zero-copy transmission paths.
- Strip unused XER, PER, and OER codec support via persistent skeleton gating.
- Refactor high-frequency ASN.1 logic to use stack allocation.
- Implement zero-copy transmission path using 32-byte header offset in UART TX buffer.
- Correct CCID header initialization and DER encoding buffer size calculation.
- Add ASN_DISABLE_* macros to application.fam for consistent gating across builds.
* Faster Memory Handling: Moved most ASN.1 objects from heap allocation to stack allocation. This reduces allocator pressure and fragmentation. 📉
* Smarter Cleanup: Updated cleanup to use a targeted path. Internal data is cleared only where needed, reducing overhead. 🧹
* Cleaner Initialization: Switched to C99-style initializers ({0}) for idiomatic zero-init before encoder use.
Refs: https://github.com/cindersocket/seader/issues/2
The app was definitely carrying some extra weight that we didn't need.
* Stripped the Bloat: I fully gated out the OER, PER, and XER support libraries. Even though some generation flags were there, the actual library code was still being linked. I also removed the random_fill logic since we aren't using it.
* Big Wins: The binary is now 7 KB smaller 📉. I verified this by checking the symbol table—all those extra codec functions are officially gone.
* Bug Fix: I found a pretty serious issue in sam_api.c where the local calloc was just a wrapper for malloc and wasn't actually zeroing out memory. I added a memset fix so we don't run into any weird non-deterministic crashes. 🛠️
* Stack Optimization: Since the ASN.1 path is much leaner now, I was able to safely drop the stack size in application.fam from 5 KB to 3 KB.
Refs: https://github.com/cindersocket/seader/issues/2