Update APIs with the latest project-panama changes

This commit is contained in:
Chris Vest 2021-04-26 17:08:40 +02:00
parent 9c87dc8208
commit b396252682

View File

@ -60,7 +60,7 @@ public class NativeMemorySegmentManager extends AbstractMemorySegmentManager {
@Override
protected MemorySegment createSegment(long size, Cleaner cleaner) {
final ResourceScope scope = cleaner == null ? newSharedScope() : newSharedScope(cleaner);
scope.addOnClose(getCleanupAction(size));
scope.addCloseAction(getCleanupAction(size));
var segment = MemorySegment.allocateNative(size, scope);
MEM_USAGE_NATIVE.add(size);
return segment;