From dae2f33848a60003096681ae18e719aee9936112 Mon Sep 17 00:00:00 2001 From: Wade Walker Date: Tue, 25 Jan 2011 09:45:09 -0600 Subject: Fix bug 463 where gluScaleImage consumes all memory Changes the Type_Widget.java constructor to allocate a normal buffer instead of a direct buffer. Apparently JVMs can't allocate small direct buffers efficiently, and since Type_Widget is called inside tight loops millions of times, we can't afford to do it this way. This commit restores it to how it was in JOGL 1. --- src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Type_Widget.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/jogl') diff --git a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Type_Widget.java b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Type_Widget.java index b329840ef..0aeca8f1c 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Type_Widget.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/glu/mipmap/Type_Widget.java @@ -56,7 +56,9 @@ public class Type_Widget { /** Creates a new instance of Type_Widget */ public Type_Widget() { - buffer = ByteBuffer.allocateDirect( 4 ); + // can't make this direct, because JVM doesn't allocate small direct buffers efficiently + // see https://jogamp.org/bugzilla/show_bug.cgi?id=463 for details + buffer = ByteBuffer.allocate( 4 ); } public void setUB0( byte b ) { -- cgit v1.2.3