Skip to content

Commit 3928276

Browse files
committed
log basic addRef()
1 parent e674dde commit 3928276

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/main/java/software/amazon/awssdk/crt/CrtResource.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,13 @@ public long getNativeHandle() {
244244
* Increments the reference count to this resource.
245245
*/
246246
public void addRef() {
247-
refCount.incrementAndGet();
247+
int remainingRefs = refCount.incrementAndGet();
248+
249+
if (debugNativeObjects) {
250+
Log.log(ResourceLogLevel, Log.LogSubject.JavaCrtResource,
251+
String.format("Instance of class %s(%d) is adding a reference. RefCount is now %d",
252+
this.getClass().getCanonicalName(), id, remainingRefs));
253+
}
248254
}
249255

250256
/**

0 commit comments

Comments
 (0)