News for hackers. Stuff that matters.
Re:Java’s new garbage collector promises low pause times on ... by gameswithgo on Thursday August 30, 2018 @02:36PM (#17879439)
You can do that, and people do. However a GC language doesn't normally give you the flexibility of getting a block of memory and doing whatever you want inside it, instead you use things like object pools.
Re:Java’s new garbage collector promises low pause times on ... by jakewins on Thursday August 30, 2018 @07:46PM (#17881813)
You can allocate a block of memory with `ByteBuffer.allocate()` or, if you want it outside the JVM heap, `ByteBuffer.allocateDirect()`.

You lose all the object/memory management features, though there are some projects around to provide struct-like APIs: https://github.com/alaisi/nalloc

Re:Java’s new garbage collector promises low pause times on ... by pjmlp on Thursday August 30, 2018 @05:57PM (#17881168)
System.Runtime.InteropServices.Marshal in C#'s case.
Re:Java’s new garbage collector promises low pause times on ... by louthy on Thursday August 30, 2018 @06:54PM (#17881523)
Also `fixed` in C# [1]

Not used Span<T> and Memory<T> [2] in anger yet, but they also seem to be attacking the issue from the other end

[1] https://docs.microsoft.com/en-us/dotnet/csharp/language-refe...

[2] https://blogs.msdn.microsoft.com/mazhou/2018/03/25/c-7-serie...

Re:Java’s new garbage collector promises low pause times on ... by VikingCoder on Thursday August 30, 2018 @06:35PM (#17881395)
I consider object pools to be well within that family of problem solving that I'm talking about.