Repository navigation
v0.20.0
Added
- Pass a retained image wherever images are selected with
ImageSelector.image(_:). This includesresolve(_:in:),NativeSymbolRequest.imageScopes,resolveImages(matching:), and the importer scope of hooks. - Select a C function by its exact spelling when its layout is described at run time, with
DynamicNativeFunctionRequest.function(linkerName:signature:)andfunction(machOName:signature:).
Changed
ABIRuntimeandNativeSwiftTypeareSendablefinal classes. They were actors whose members were all nonisolated.- Hooks and replacements report their outcomes through one set of types:
NativeHookInvocationError,NativeHookSlotStatus, andNativePointerSlotMutation. - Imported hooks and imported replacements of a Swift function or method use the runtime that resolved the handle. Earlier releases used the shared runtime's import indexes unless
using:was passed. - The C++ wrapper names the shared runtime
abi_bridge::runtime::shared(), matchingABIRuntime.shared. - The documentation of
ABIRuntimestates what a runtime owns (its resolution caches and image leases), what belongs to the process, and when to create a separate runtime.
Fixed
- Concurrent calls through Swift handles no longer wait on a process-wide lock once the values involved are tied to the same loaded code. In 0.19.1, a callback invoked from many threads could queue behind that lock.
- Resolving Swift declarations in large images is faster. In a 13 MB image with 115,000 exports, a function whose result needs an inferred value convention resolves in about 254 ms instead of 438 ms, and a plain function in about 190 ms instead of 227 ms.
Compatibility
This release changes source that uses the APIs below.
- Retained images. The
in: NativeImageoverloads ofresolve,resolveAndWait, andcxxObjectare removed. Replacein: imagewithin: .image(image). A storedImageSelectororNativeSymbolRequestthat holds.imagekeeps that image loaded. Thefrom:provider filter of imported hooks, monitors, and replacements rejects.image; keep using.installName,.framework, or.paththere. - Actors. Code that used
ABIRuntimeorNativeSwiftTypeas an actor, for example as anisolatedparameter or asany Actor, no longer compiles. Other call sites are unchanged. - Hook errors. Replace
NativeImportedInvocationError,NativeVirtualInvocationError, andNativeSwiftHookInvocationErrorwithNativeHookInvocationError.NativeObjCMethodHookErrorno longer hasexpiredInvocationandwrongThread; catchNativeHookInvocationErrorfor those. - Slot status and mutations. Replace the nested
StatusofNativeImportedFunctionHook,NativeVirtualHook, andNativeSwiftImportedFunctionHookwithNativeHookSlotStatus. Replace their nestedMutationtypes andNativeSwiftReplacementMutationwithNativePointerSlotMutation, and read itsoutcomeenum instead of comparing theInt32status. - Swift imported hooks. Remove the
using:argument fromhookImportedCalls,hookMainActorImportedCalls,prepareImportedReplacement, andprepareImportedReplacementAndWait. A handle resolved by an independentABIRuntime()now reads that runtime's import indexes. - C++. Replace
abi_bridge::runtime::current()withabi_bridge::runtime::shared().
Full Changelog: v0.19.1...v0.20.0