5 ms·
If you care so deeply about memory access that you want control over stack allocation, you probably care enough that you don't want a GC. What's your use case w
by jppittma 3y ago
If you care so deeply about memory access that you want control over stack allocation, you probably care enough that you don't want a GC. What's your use case where the GC doesn't murder you, but you care about better cache locality?
- adgjlsfhk1 3y agoObjects on the stack don't participate in the GC (technically they're GC roots). Half of the reason you want to be able to put variables on the stack is because the stack variables are managed by lifetime and therefore the GC doesn't have to collect them.
- thfuran 3y agoIsn't more explicit control of memory allocation useful precisely in the places where the default behavior would murder you? I don't see the incompatibility. Many python and java programs have portions that are native code for performance reasons (though that's not necessarily just about GC). What's relatively rare is a program where the whole thing is absolutely performance critical rather than just some parts.