3 ms·
Was `Coordinate` a class or a struct? C# structs generally [0][1] don't force use of the garbage-collected heap. [0] https://blogs.msdn.microsoft.com/ericlippe
by MaxBarraclough 8y ago
Was `Coordinate` a class or a struct? C# structs generally [0][1] don't force use of the garbage-collected heap.
[0] https://blogs.msdn.microsoft.com/ericlippert/2010/09/30/the-truth-about-value-types/ https://blogs.msdn.microsoft.com/ericlippert/2010/09/30/the-... (ignore the usual comments telling the reader they are wrong for wondering about whether the garbage-collected heap is used)
[1] https://jacksondunstan.com/articles/3453 https://jacksondunstan.com/articles/3453
- slavik81 8y agoMinecraft is a Java application.
- MaxBarraclough 8y agoDerp, of course! Mention of Microsoft threw me off :-P In the JVM, there are of course no structs, but I'd expect the escape analysis optimisations in the HotSpot JIT to reduce it down to avoiding any GC churn. If this isn't happening, I'm curious as to why.