From 687ca5f02d22fa489cf0e7dd4dd3c5e9fcfa7b19 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Mon, 16 Jan 2012 14:09:13 -0800 Subject: j3dcore: remove temporary Point3d from BoundingBox Rely on escape analysis in the VM here, this method could be coded more carefully anyway to avoid most of the floating point math. On 64-bit reduces BoundingBox from 70->62 bytes Signed-off-by: Harvey Harrison --- src/classes/share/javax/media/j3d/BoundingBox.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src') diff --git a/src/classes/share/javax/media/j3d/BoundingBox.java b/src/classes/share/javax/media/j3d/BoundingBox.java index 817b831..6a41dbd 100644 --- a/src/classes/share/javax/media/j3d/BoundingBox.java +++ b/src/classes/share/javax/media/j3d/BoundingBox.java @@ -62,7 +62,6 @@ final Point3d upper; // reusable temp objects private BoundingSphere tmpSphere = null; private BoundingPolytope tmpPolytope = null; - private Point3d tmpP3d = null; // Issue 561: Set by -Dj3d.releaseBoundingBoxMemory property. // When set to true, the per-instance fields used in bounding box @@ -699,9 +698,7 @@ public void setUpper(Point3d p1) { if (boundsIsInfinite) return; - if (tmpP3d == null) { - tmpP3d = new Point3d(); - } + Point3d tmpP3d = new Point3d(); double ux, uy, uz, lx, ly, lz; ux = upper.x; uy = upper.y; uz = upper.z; @@ -779,11 +776,6 @@ public void setUpper(Point3d p1) { if ( tmpP3d.y < lower.y ) lower.y = tmpP3d.y; if ( tmpP3d.z < lower.z ) lower.z = tmpP3d.z; - if (releaseBoundingBoxMemory) { - // Free memory - tmpP3d = null; - } - } /** -- cgit v1.2.3