debug.getbuildinfo
Defined in module
"debug"from "debug" import getbuildinfogetbuildinfo(): table
Returns a table describing the Quirrel build (version, sizes, GC status)
Return value
A table with these keys:
version- the Quirrel version stringcharsize-sizeof(char)in the build, in bytesintsize-sizeof(SQInteger)in the build, in bytesfloatsize-sizeof(SQFloat)in the build, in bytesgc-"enabled"or"disabled"
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.
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 stringSee also
collectgarbage | Runs the garbage collector and returns the number of reclaimed objects |
doc | Returns a documentation string for a function, class, or instance |
format_call_stack_string | Returns a formatted string describing the current call stack |
get_function_decl_string | Returns a function declaration string |
get_function_info_table | Returns meta information about a function as table |
get_stack_top | Returns the current VM stack top index |
getlocals | Returns a table of local variables at the given stack level |
getstackinfos | Returns call stack information for the given stack level |
| debug | module index |