From 147b78b7e49661324148be23ef5e1fcfd004d97f Mon Sep 17 00:00:00 2001 From: Not Zed Date: Sun, 26 Jan 2020 18:23:59 +1030 Subject: [PATCH] Just use the ByteBuffer address to directly unmap the memory. Thanks go to Maurizio Cimadamore for the suggestion. --- .../classes/au/notzed/zcl/CLCommandQueue.java | 36 ++----------------- .../tests/au/notzed/zcl/CLBufferTest.java | 2 ++ 2 files changed, 5 insertions(+), 33 deletions(-) diff --git a/src/notzed.zcl/classes/au/notzed/zcl/CLCommandQueue.java b/src/notzed.zcl/classes/au/notzed/zcl/CLCommandQueue.java index f878bb8..063b480 100644 --- a/src/notzed.zcl/classes/au/notzed/zcl/CLCommandQueue.java +++ b/src/notzed.zcl/classes/au/notzed/zcl/CLCommandQueue.java @@ -1343,22 +1343,6 @@ public class CLCommandQueue extends CLExtendable { } } - private MemoryAddress getMap(ByteBuffer bb) { - synchronized (maps) { - // Note this can't use a hashtable as ByteBuffer - // hashes on state like position. - for (int i=0;i