OpenCL uses PointerBuffer.allocateDirect which is discouraged and a performance issue
Hello. I wonder why does the OpenCL implementation uses PointerBuffer.allocateDirect and not the MemoryStack?
As from the LWJGL documentation PointerBuffer.allocateDirect is discourage and slower than MemoryStack.
https://blog.lwjgl.org/memory-management-in-lwjgl-3/
Use of ByteBuffer.allocateDirect() is highly discouraged. It is slow, much slower than the raw malloc() call. A lot of overhead on top of a function that is already slow. All of that contributed to users adopting one or more bad practices when dealing with LWJGL code:
Using buffer instance pools. (which JME3 indeed uses) Using global buffer instances, often not in a concurrent-safe way.[...] Always prefer stack allocation. The solution is the org.lwjgl.system.MemoryStack class that exposes an API for stack allocations.
Would there be any interest in replacing the PointerBuffer.allocateDirect with MemoryStack? Or was there a deeper reason why MemoryStack wasn't used?