Skip to content

BufferAllocator Round 2 - #533

Merged
shadowislord merged 11 commits into
jMonkeyEngine:masterfrom
empirephoenix:master
Jul 26, 2016
Merged

BufferAllocator Round 2#533
shadowislord merged 11 commits into
jMonkeyEngine:masterfrom
empirephoenix:master

Conversation

@empirephoenix

Copy link
Copy Markdown
Contributor

Allows a flexible interface to use own Allocators.

This has two uses:

  1. the current one does not work at all under Java9 (and it brings a simpler one that does)
  2. it allows to use better/faster native ones, like the ones included in lwjgl and jogl2.

The default behavior is trying to load the old reflection based one, and Fallback to the simpler if an exception occurs. This allows to use JME in java9, while not changing established behavior.

Kai Boernert and others added 9 commits July 9, 2016 11:57
Signed-off-by: Kai Boernert <kai-boernert@visiongamestudios.de>
Signed-off-by: Kai Boernert <kai-boernert@visiongamestudios.de>
Signed-off-by: Kai Boernert <kai-boernert@visiongamestudios.de>
jemalloc allocator and reflection allocator fix
Revert "jemalloc allocator and reflection allocator fix"
Signed-off-by: Kai Boernert <kai-boernert@visiongamestudios.de>
@shadowislord

Copy link
Copy Markdown
Member

Looks good, however it is using tabs instead of spaces.
Recommend to use 4 spaces instead to be consistent with the rest of the engine, then it would be A-OK

Signed-off-by: Kai Boernert <kai-boernert@visiongamestudios.de>
@empirephoenix

Copy link
Copy Markdown
Contributor Author

@shadowislord changed to use whitespaces

@shadowislord

Copy link
Copy Markdown
Member

@empirephoenix PrimitiveAllocator and BufferUtils still use tabs

Signed-off-by: Kai Boernert <kai-boernert@visiongamestudios.de>
@shadowislord

Copy link
Copy Markdown
Member

LGTM
@pspeed42 do you have any concerns about this?

@shadowislord

Copy link
Copy Markdown
Member

Guess not..

@shadowislord
shadowislord merged commit 651753c into jMonkeyEngine:master Jul 26, 2016
@ghost

ghost commented Jul 29, 2016

Copy link
Copy Markdown

sun.nio.ch.DirectBuffer is inaccessible in Java 1.9 but sun.misc.Cleaner is still accessible according to the JEP 260. Therefore, ReflectionAllocator would go on working if you stopped using the former but not the latter.

@empirephoenix

Copy link
Copy Markdown
Contributor Author

Good to know,
but thats the good thing with this change,
it's now super easy to write a specialized allocator for this case, and everyone can easily decide for himself what the requirements in the own game are.

I personally will probably switch to the lwjgl/jogl native allocator interfaces for performance reasons :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants