Reduct  v4.0.5-1-g4851deb
A functional and immutable language.
Loading...
Searching...
No Matches
reduct_atom_t Struct Reference

Atom structure. More...

#include <atom.h>

Collaboration diagram for reduct_atom_t:

Data Fields

uint32_t length
 The length of the string (must be first, check the reduct_item_t structure).
 
uint32_t hash
 The hash of the string.
 
uint32_t index
 The index within the atom map.
 
reduct_atom_flags_t flags
 Atom flags.
 
uint8_t _padding [3]
 
char * string
 Pointer to the data.
 
union { 
 
   char   smallString [REDUCT_ATOM_SMALL_MAX
 Small string data, atom must not have REDUCT_ATOM_FLAG_LARGE. More...
 
   reduct_arena_t *   arena 
 The arena that this atoms string was allocated from, atom must have REDUCT_ATOM_FLAG_LARGE. More...
 
};  
 
union { 
 
   struct { 
 
      reduct_schema_index_t *   schema 
 
      uint32_t   schemaCount 
 
   }  
 
   double   numberValue 
 Pre-computed number value, atom must have REDUCT_ATOM_FLAG_NUMBER. More...
 
   struct { 
 
      reduct_native_fn   native 
 Cached native function, atom must have REDUCT_ATOM_FLAG_NATIVE. More...
 
      reduct_native_intrinsic_fn   intrinsic 
 Cached intrinsic function, atom must have REDUCT_ATOM_FLAG_NATIVE. More...
 
   }  
 
};  
 

Detailed Description

Atom structure.

Definition at line 87 of file atom.h.

Field Documentation

◆ length

uint32_t reduct_atom_t::length

The length of the string (must be first, check the reduct_item_t structure).

Definition at line 89 of file atom.h.

◆ hash

uint32_t reduct_atom_t::hash

The hash of the string.

Definition at line 90 of file atom.h.

◆ index

uint32_t reduct_atom_t::index

The index within the atom map.

Definition at line 91 of file atom.h.

◆ flags

reduct_atom_flags_t reduct_atom_t::flags

Atom flags.

Definition at line 92 of file atom.h.

◆ _padding

uint8_t reduct_atom_t::_padding[3]

Definition at line 93 of file atom.h.

◆ string

char* reduct_atom_t::string

Pointer to the data.

Definition at line 94 of file atom.h.

◆ smallString

char reduct_atom_t::smallString[REDUCT_ATOM_SMALL_MAX]

Small string data, atom must not have REDUCT_ATOM_FLAG_LARGE.

Definition at line 96 of file atom.h.

◆ arena

reduct_arena_t* reduct_atom_t::arena

The arena that this atoms string was allocated from, atom must have REDUCT_ATOM_FLAG_LARGE.

Definition at line 98 of file atom.h.

◆ [union]

union { ... } reduct_atom_t

◆ schema

reduct_schema_index_t* reduct_atom_t::schema

An array of indexes to which this atom is a key.

The array is indexed by the schema id and stores the index of the field within the schema.

Definition at line 108 of file atom.h.

◆ schemaCount

uint32_t reduct_atom_t::schemaCount

Definition at line 109 of file atom.h.

◆ numberValue

double reduct_atom_t::numberValue

Pre-computed number value, atom must have REDUCT_ATOM_FLAG_NUMBER.

Definition at line 111 of file atom.h.

◆ native

reduct_native_fn reduct_atom_t::native

Cached native function, atom must have REDUCT_ATOM_FLAG_NATIVE.

Definition at line 114 of file atom.h.

◆ intrinsic

reduct_native_intrinsic_fn reduct_atom_t::intrinsic

Cached intrinsic function, atom must have REDUCT_ATOM_FLAG_NATIVE.

Definition at line 116 of file atom.h.

◆ [union]

union { ... } reduct_atom_t

The documentation for this struct was generated from the following file: