AcediaDocumentation

Functions & hooks

Closures, callable identity, function hooks and prototype hooks.

These calls inspect closures and replace function behavior.

  • Keep the callable original returned by a hook if your replacement needs to delegate.
  • Restore the target when finished.

See changing a function temporarily before using lower-level prototype hooks.

Functions

FunctionPurpose
iscclosureChecks whether a function is a C closure.
islclosureChecks whether a function is a Lua closure.
isexecutorclosureChecks whether Acedia created a function.
isnewcclosureChecks whether a function is an executor C wrapper.
getfunctionhashComputes a content hash for a Lua function.
newcclosureWraps a function in an executor C closure.
newlclosureCreates a Lua closure that forwards to another function.
clonefunctionCreates a separate closure with the original function's behavior.
checkcallerReports whether the current call is attributed to executor code.
isourthreadChecks whether a thread belongs to executor code.
comparefunctionsChecks whether two functions are the same closure or forward to the same root.
setstackhiddenControls whether a stack level appears in supported stack reports.
hookfunctionReplaces a function's behavior and returns a callable copy of its previous behavior.
restorefunctionRestores a function or registered metamethod hook.
isfunctionhookedChecks whether a function has a recorded function or metamethod hook.
hookmetamethodReplaces a function-valued metamethod and returns its original implementation.
hookprotoRedirects existing closures sharing a Lua prototype to a replacement function.
restoreprotoRestores closures affected by a recorded prototype hook.
isprotohookedChecks whether a function uses a recorded hooked prototype.
oth.hookInstalls an off-thread hook for a C function.
oth.unhookRemoves the most recently matching off-thread hook.
oth.get_root_callbackReturns the original callback of the active off-thread hook.
oth.is_hook_threadChecks whether an off-thread hook callback is active.
oth.get_original_threadReturns the caller thread of the active off-thread hook.

On this page