Stack with memory protection mechanisms
- Every operation can fail (and throw corresponding exception).
- Stack has canaries before and after it's fields.
- Stack calculates checksum of its fields and checks it before every operation.
- If object is moved out to a new place, it is marked as invalid
(
size
becomes bigger thancapacity
). Any operation on invalid object throws exception.
- app/ - Applications (each application has it's own
main
function)- main.cpp - Main application
- docs/ - Documentation pages
- mainpage.md - Documentation main page
- extern/ - external libraries (i.e. googletest)
- include/ - header files
- safe_stack/ - safe stack header files
- hash.h - small library for computing object's hash
- safe_stack.h - stack class definition, exception types and helper functions
- safe_stack/ - safe stack header files
- test/ - program tests
- hash_test.cpp - tests for hash function
- safe_stack_test.cpp - tests for stack
I used Ubuntu 20.04 on WSL
git clone --recursive https://github.com/pema4/safe_stack
cd safe_stack
cmake -B build
cmake --build build -t tests
build/test/tests
cmake --build build -t main
build/app/main