io.vproxy.pni.impl.SegmentAllocatorAllocator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pni-api-jdk22 Show documentation
Show all versions of pni-api-jdk22 Show documentation
panama native interface pni-api-jdk22
The newest version!
package io.vproxy.pni.impl;
import io.vproxy.pni.Allocator;
import java.lang.foreign.MemorySegment;
import java.lang.foreign.SegmentAllocator;
public class SegmentAllocatorAllocator extends AbstractAllocator implements Allocator {
private final SegmentAllocator allocator;
public SegmentAllocatorAllocator(SegmentAllocator allocator) {
this.allocator = allocator;
}
@Override
public MemorySegment allocate(long size) {
return allocator.allocate(size);
}
@Override
public MemorySegment allocate(long size, int alignment) {
return allocator.allocate(size, alignment);
}
}