8260966: (fs) Consolidate Linux and macOS implementations of UserDefinedFileAttributeView

8260691: (fs) LinuxNativeDispatcher should link to xattr functions

Reviewed-by: alanb
This commit is contained in:
Sebastian Stenzel 2021-03-02 14:40:45 +00:00 committed by Alan Bateman
parent 5f4bc0aca6
commit 0de6abd4b4
16 changed files with 555 additions and 977 deletions

View file

@ -33,7 +33,7 @@ import jdk.internal.ref.CleanerFactory;
* A light-weight buffer in native memory.
*/
class NativeBuffer {
class NativeBuffer implements AutoCloseable {
private static final Unsafe unsafe = Unsafe.getUnsafe();
private final long address;
@ -61,6 +61,11 @@ class NativeBuffer {
.register(this, new Deallocator(address));
}
@Override
public void close() {
release();
}
void release() {
NativeBuffers.releaseNativeBuffer(this);
}