Skip to content

Commit 0ce97fc

Browse files
committed
Skip some more potentially synchronized code in Pointer with "org.bytedeco.javacpp.nopointergc" (issue tensorflow/java#313)
1 parent 343045d commit 0ce97fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/bytedeco/javacpp/Pointer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ static class DeallocatorReference extends PhantomReference<Pointer> implements D
283283
DeallocatorReference(Pointer p, Deallocator deallocator) {
284284
super(p, referenceQueue);
285285
this.deallocator = deallocator;
286-
this.bytes = p.capacity * p.sizeof();
286+
this.bytes = p.capacity != 0 && referenceQueue != null ? p.capacity * p.sizeof() : 0;
287287
this.count = new AtomicInteger(0);
288288
}
289289

0 commit comments

Comments
 (0)