VariantConstructors
gdext.builtin.VariantConstructors
object VariantConstructors
Caches the engine's per-type Variant constructor functions.
get_variant_from_type_constructor / ..._to_type_constructor are relatively expensive lookups, but the function pointer they return is stable for the lifetime of the process. gdext caches these in a table indexed by variant type; we do the same.
Variant type tags are small contiguous integers (NIL=0 .. MAX), so a flat array indexed by the tag is the natural cache. The cache is populated lazily on first use of each type and never invalidated.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
VariantConstructors.type
Members list
In this article