Skip to content

AnyType

IsaacShelton edited this page Mar 21, 2022 · 1 revision

AnyType

AnyType represents the type of runtime type information.

Specifications

Type Size Memory Management Model File
AnyType 32 bytes None N/A

Definition

struct AnyType (kind AnyTypeKind, name *ubyte, is_alias bool, size usize)

Fields

Name Type Description
kind AnyTypeKind What kind of type
name *ubyte Human readable name of the type
is_alias bool Whether the type is an alias
size usize Size of the type in bytes

As a Value Header

Most *AnyType values don't directly refer to an AnyType, but rather one of the types like AnyType such as AnyStructType or AnyPtrType. Which kind of type it is can be determined by examining the kind of AnyType.

More detailed overlapping structs include:

Usage in __types__

When runtime type information is enabled, the compiler will include the global variables __types__ and __types_length__:

__types__ **AnyType
__types_length__ usize

These contain runtime type information for every type used in the program.

Clone this wiki locally