Skip to content

cgs_variant

Chris Schick edited this page Feb 20, 2023 · 1 revision

The cgs_variant is a solution to storing generic values with as little allocation as possible.

The goal is to keep the size of the variant to two machine words. On a 64-bit system this is 16-bytes and looks like:

Bytes: [1][2][3][4][5][6][7][8]
Type:  [---enum---][--unused--]
Data:  [---union--------------]
Clone this wiki locally