You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: extract native-call helpers into NativeCall (#14)
* refactor: extract native-call helpers into NativeCall
Move the FFM-downcall conventions out of Zstd into a dedicated
package-private NativeCall:
- interface ZstdCall (was SizeCall)
- checkReturnValue(ZstdCall) (was call) — run a size_t call, decode a
ZSTD_isError code into a ZstdException
- isError / errorCode / errorName
- requireNative segment guard
Zstd keeps its one-shot byte[] API plus copyIn/copyOut. All call sites
(contexts, streams, dicts, frame, bounds) repointed. No behaviour change;
these are all package-private internals.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* refactor: collapse 13 copies of the sneaky-rethrow helper into NativeCall
Every binding class carried its own private rethrow/sneaky to launder the
checked Throwable from MethodHandle.invokeExact. Replace them with one
shared NativeCall.rethrow and repoint all catch blocks.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* refactor: read ZSTD_bounds via the named layout, not magic offsets
Name BOUNDS_LAYOUT's fields (error/lowerBound/upperBound) and derive the
read offsets from it with byteOffset(groupElement(...)), so the struct
reads track the definition instead of hand-counted 0/8/12. Document how
the struct-by-value return allocates through the arena SegmentAllocator.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments