3 ms·
> What I'm talking about is a hypothetical language that makes memory operations in critical sections forbidden and considered a compilation error. This is eas
by com2kid 5y ago
> What I'm talking about is a hypothetical language that makes memory operations in critical sections forbidden and considered a compilation error.
This is easy to do in C, and you'll see it in embedded code. A simple preprocessor macro that redefined malloc to something that causes an error.
To enable malloc in some chunk of code (embedded defaults to "malloc is bad"), you can define it accordingly in the .c files that need it.