Skip to main content

load_patch_library

Function load_patch_library 

Source
pub unsafe fn load_patch_library(path: &Path) -> Result<Library, PatchError>
Expand description

Load path with the platform loader apply_patch uses: dlopen/LoadLibrary through libloading on desktop, the memfd + android_dlopen_ext path on Android (which lets a library outside the app’s native-library directory load on a non-rooted device).

§Safety

Loading a library runs its initialisers, which can do anything: path must be a library built to be loaded into this process. The returned handle must never be dropped while code from it may still run.