Skip to main content

Module loader

Module loader 

Source
Expand description

Tier-2 modular nv_get_interface cdylib hot-swap loader.

Resolves the single nv_get_interface entry point once at load time, caches the small const interface tables (NvSurfaceApi, plus optional NvLayoutApi, NvComponentApi, NvDevApi), and exposes direct zero-cost calls + state-preserving generation reloads.

Structs§

HotAppInstance
ReloadOutcome
Summary returned after a successful transactional HotAppInstance::reload.
StagedDylib
Canonical RAII dynamic-library loader. On desktop it stages a unique copy in a private (0700, per-user, exclusively created) staging directory before calling dlopen (a rebuilt file at the same path always runs new code; no Windows DLL locks) and unloads before removing the copy. On Android / iOS it loads the file in place (STAGES_PRIVATE_COPY) unless MODULE_STAGE_DIR_ENV names a staging root, permitting unchanged bundle re-opens while refusing reloads whose bytes changed on disk.

Enums§

LoaderError

Constants§

MODULE_STAGE_DIR_ENV
Environment variable naming the staging root (instead of std::env::temp_dir()); set, it stages on every platform.
STAGES_PRIVATE_COPY
Whether StagedDylib loads a private copy (desktop) or the file in place (mobile).

Functions§

is_valid_nv_interface_symbol
Returns true iff symbol is "nv_get_interface" or "nv_get_interface_" followed by one or more ASCII [A-Za-z0-9_] characters (never embedded NULs or arbitrary process symbols).
resolve_in_process_symbol
Resolves a validated nv_get_interface* symbol from the running process image.
staging_dir
The private directory staged copies for subdir go to (<root>/<subdir>-<euid> on unix, so users sharing /tmp never collide; temp_dir() is already per user on Windows); None when loading in place.