|
@@ -20,6 +20,21 @@ public class LWJGLBufferAllocator implements BufferAllocator {
|
|
private static final Logger LOGGER = Logger.getLogger(LWJGLBufferAllocator.class.getName());
|
|
private static final Logger LOGGER = Logger.getLogger(LWJGLBufferAllocator.class.getName());
|
|
|
|
|
|
public static final String PROPERTY_CONCURRENT_BUFFER_ALLOCATOR = "com.jme3.lwjgl3.ConcurrentBufferAllocator";
|
|
public static final String PROPERTY_CONCURRENT_BUFFER_ALLOCATOR = "com.jme3.lwjgl3.ConcurrentBufferAllocator";
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * The reference queue.
|
|
|
|
+ */
|
|
|
|
+ private static final ReferenceQueue<Buffer> DUMMY_QUEUE = new ReferenceQueue<>();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * The cleaner thread.
|
|
|
|
+ */
|
|
|
|
+ private static final Thread CLEAN_THREAD = new Thread(LWJGLBufferAllocator::freeByteBuffers);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * The map with created deallocators.
|
|
|
|
+ */
|
|
|
|
+ private static final Map<Long, Deallocator> DEALLOCATORS = new ConcurrentHashMap<>();
|
|
|
|
|
|
/**
|
|
/**
|
|
* Threadsafe implementation of the {@link LWJGLBufferAllocator}.
|
|
* Threadsafe implementation of the {@link LWJGLBufferAllocator}.
|
|
@@ -63,11 +78,6 @@ public class LWJGLBufferAllocator implements BufferAllocator {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * The reference queue.
|
|
|
|
- */
|
|
|
|
- private static final ReferenceQueue<Buffer> DUMMY_QUEUE = new ReferenceQueue<>();
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* The LWJGL byte buffer deallocator.
|
|
* The LWJGL byte buffer deallocator.
|
|
*/
|
|
*/
|
|
@@ -128,16 +138,6 @@ public class LWJGLBufferAllocator implements BufferAllocator {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * The cleaner thread.
|
|
|
|
- */
|
|
|
|
- private static final Thread CLEAN_THREAD = new Thread(LWJGLBufferAllocator::freeByteBuffers);
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * The map with created deallocators.
|
|
|
|
- */
|
|
|
|
- private static final Map<Long, Deallocator> DEALLOCATORS = new ConcurrentHashMap<>();
|
|
|
|
-
|
|
|
|
static {
|
|
static {
|
|
CLEAN_THREAD.setDaemon(true);
|
|
CLEAN_THREAD.setDaemon(true);
|
|
CLEAN_THREAD.setName("Thread to free LWJGL byte buffers");
|
|
CLEAN_THREAD.setName("Thread to free LWJGL byte buffers");
|