3 ms·
Unlike C, Zig offers spatial memory safety, but it does not offer temporal memory safety.
by ngrilly 2y ago
Unlike C, Zig offers spatial memory safety, but it does not offer temporal memory safety.
- do_not_redeem 2y agoZig only has spatial memory safety in limited situations. For example: If you use many-pointers anywhere in your codebase, those places have no spatial memory safety. If you compile in ReleaseFast, you have no spatial memory safety at all.
- throwawaymaths 2y agoin practice though you should be compiling ReleaseSafe and activating ReleaseFast only in functions where you need it (and that is the default)
- lukaslalinsky 2y agoEven the Zig compiler is built with ReleaseFast for the published binaries.
- throwawaymaths 2y agonot sure what you think the safety parameters for compilation should be.