Stensal SDK: Retrofitting C/C++ code with quasi-memory-safety
stensal.com
stensal.com
From briefly looking at the assembly, it seems like each variable or stack object has metadata associated with it in the stack frame. Some of this metadata seems pretty heavyweight, e.g. having `0xDEADBEEF` as a magic constant, what looks like the size, a pointer to a global variable, etc. One worry is that this metadata appears adjacent to memory it protects.
I wonder if it would be easier to just make all local variables into heap allocations and handle things uniformly there. This would make it easier to upgrade the runtime in the future without requiring recompilation.
Hope this clarify what I meant your idea will make C like Java.
You want to give Stensal SDK a try, you will find it's easier to use provided Stensal SDK can build your code. If you have any problems, feel free to send bugs report to support@stensal.com. What communication method do you prefer? a mailing list.
I want to make C/C++ more user friendly and less scary to beginners. If you love C, you should keep enjoying coding in C and worry less about the memory safety issues. With the advancement of tooling (You will see more advanced static analyzers and runtime analyzers coming out from academia and the industry), it will be less a problem in the future.
The simplicity and portability of C is its key strength that no other languages have. Once the memory safety issue is alleviated, the simplicity of C will help us to build less complex but more functional and reliable code.
C++ is just a completely different beast that I have to support.