From ebb2fca18f9a433d8be9139a7692c9e9c20d7e9a Mon Sep 17 00:00:00 2001 From: "PSp..om" Date: Mon, 30 Jan 2012 10:49:40 +0000 Subject: [PATCH] Renamed the destroyByteBuffer method to destroyDirectBuffer because it more appropriately says what it does and this is a relatively new method. After changing it to work with any direct buffer it seemed inappropriately named. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9121 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/util/BufferUtils.java | 14 +++++++------- .../test/jme3test/app/TestReleaseDirectMemory.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/engine/src/core/com/jme3/util/BufferUtils.java b/engine/src/core/com/jme3/util/BufferUtils.java index 719d4832a..668621e6f 100644 --- a/engine/src/core/com/jme3/util/BufferUtils.java +++ b/engine/src/core/com/jme3/util/BufferUtils.java @@ -1145,18 +1145,18 @@ public final class BufferUtils { } /** - * DirectByteBuffers are garbage collected by using a phantom reference and a + * Direct buffers are garbage collected by using a phantom reference and a * reference queue. Every once a while, the JVM checks the reference queue and - * cleans the DirectByteBuffers. However, as this doesn't happen - * immediately after discarding all references to a DirectByteBuffer, it's - * easy to OutOfMemoryError yourself using DirectByteBuffers. This function - * explicitly calls the Cleaner method of a DirectByteBuffer. + * cleans the direct buffers. However, as this doesn't happen + * immediately after discarding all references to a direct buffer, it's + * easy to OutOfMemoryError yourself using direct buffers. This function + * explicitly calls the Cleaner method of a direct buffer. * * @param toBeDestroyed - * The DirectByteBuffer that will be "cleaned". Utilizes reflection. + * The direct buffer that will be "cleaned". Utilizes reflection. * */ - public static void destroyByteBuffer(Buffer toBeDestroyed) { + public static void destroyDirectBuffer(Buffer toBeDestroyed) { if (!toBeDestroyed.isDirect()) { return; diff --git a/engine/src/test/jme3test/app/TestReleaseDirectMemory.java b/engine/src/test/jme3test/app/TestReleaseDirectMemory.java index 0c8c9f1ca..7446919a7 100644 --- a/engine/src/test/jme3test/app/TestReleaseDirectMemory.java +++ b/engine/src/test/jme3test/app/TestReleaseDirectMemory.java @@ -60,7 +60,7 @@ public class TestReleaseDirectMemory extends SimpleApplication { @Override public void simpleUpdate(float tpf) { ByteBuffer buf = BufferUtils.createByteBuffer(500000); - BufferUtils.destroyByteBuffer(buf); + BufferUtils.destroyDirectBuffer(buf); } }