Quirrel4.41.0

debug.getbuildinfo

Defined in module "debug"
from "debug" import getbuildinfo
getbuildinfo(): table

Returns a table describing the Quirrel build (version, sizes, GC status)

Return value

A table with these keys:

Notes

These values describe the native build, not the script talking to it, so they are the same for every VM this process creates. This engine always compiles with _SQ64 and without SQUSEDOUBLE (see include/sqconfig.h), so intsize is 8 and floatsize is 4 here; do not assume that elsewhere, since both are build choices upstream Quirrel leaves open.

Example

The values are build properties and would not stay the same across builds, so the example below only checks the shape of the table, never a value from it.

examples/debug/getbuildinfo.nut
from "debug" import getbuildinfo

let t = getbuildinfo()
let keys = []
foreach (k, v in t) keys.append(k)
keys.sort()
println("keys of getbuildinfo() =", ", ".join(keys))

// the values themselves are build properties, so only their types are stable
println("types of version/charsize/intsize/floatsize/docstring_registry_slots/gc =",
        type(t.version), type(t.charsize), type(t.intsize),
        type(t.floatsize), type(t.docstring_registry_slots), type(t.gc))
Output:
keys of getbuildinfo() = charsize, docstring_registry_slots, floatsize, gc, intsize, version
types of version/charsize/intsize/floatsize/docstring_registry_slots/gc = string integer integer integer integer string

See also

collectgarbageRuns the garbage collector and returns the number of reclaimed objects
docReturns a documentation string for a function, class, or instance
format_call_stack_stringReturns a formatted string describing the current call stack
get_function_decl_stringReturns a function declaration string
get_function_info_tableReturns meta information about a function as table
get_stack_topReturns the current VM stack top index
getlocalsReturns a table of local variables at the given stack level
getstackinfosReturns call stack information for the given stack level
debugmodule index