public interface ZstdLibrary
FFM binding for a subset of libzstd.

Java long parameters and return values map to C size_t, which is 8 bytes on every 64-bit platform Elasticsearch ships on. Binding these as int would leave the upper bits of the argument register undefined and cause libzstd to read garbage as part of the size — see #150690 for context.

The *Heap variants bind the same C symbol with @Critical so the linker can use the fast path when the caller passes on-heap memory segments.

See Also: