Skip to content

Commit

Permalink
perf(jemalloc): make the system allocator the default on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Spasi committed Aug 4, 2017
1 parent 7eafa5e commit d5c1978
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions doc/notes/3.1.3.md
Expand Up @@ -50,6 +50,10 @@ This build includes the following changes:
* Callback and struct classes.
* Struct members.
* Function parameters and return values.
- The default memory allocator on Windows is now the system allocator instead of jemalloc.
* jemalloc is not properly optimized for Windows and its performance is not competitive.
* jemalloc is still a major performance win on Linux and macOS.
* rpmalloc is faster on all platforms but requires per-thread setup, so must be enabled manually.

#### Fixes

Expand Down
Expand Up @@ -26,7 +26,7 @@ static MemoryAllocator getInstance() {
return (MemoryAllocator)allocator;
}

if (!"system".equals(allocator)) {
if (!((allocator == null && Platform.get() == Platform.WINDOWS) || "system".equals(allocator))) {
String className;
if (allocator == null || "jemalloc".equals(allocator)) {
className = "org.lwjgl.system.jemalloc.JEmallocAllocator";
Expand Down

0 comments on commit d5c1978

Please sign in to comment.