scpt_autoload_ns

March 26, 2020 Contributors

Name

scpt_autoload_ns — Wire up autoload items, just in time

Synopsis

#include "modules/scriptlets/ec_scriptlet.h"

| int **scpt_autoload_ns** ( | thr, |   |
|   | name_space); |   |

scpt_thread * <var class="pdparam">thr</var>;
const char * <var class="pdparam">name_space</var>;

Description

Wire up autoload items, just in time.

Call this from an __index function to perform just-in-time registration of global constants and other registered items.

This reduces the initial set up time for a scriptlet VM, at the cost of an extra couple of hash lookups the first time each of these constants is accessed.

Parameters

thr

The Lua VM state. For more information see “scpt_thread”.

name_space

The name space.

Return Value

This function returns 1 if any work is performed; Otherwise it returns 0.

Threading

It is legal to call this function in any thread.

See Also

Chapter 42, Scriptlet (and Alerting) Functions