Data Strucures

struct AtomsHashTable

Public Members

int capacity
int count
RWLock *lock
struct HNode **buckets
struct AtomStringIntPair

A structure to represent atom strings and int pairs. Such as {“\x8” “universe”, 42}.

Public Members

AtomString as_val
int i_val
struct AVMPackData

Public Members

const struct AVMPackInfo *obj_info
struct ListHead avmpack_head
bool in_use
int name_atom_id
const void *data
struct AVMPackInfo

Public Members

void (*destructor)(struct AVMPackData *obj, GlobalContext *global)
struct BuiltInAtomRequestSignal

Public Members

MailboxMessage base
int32_t sender_pid
term atom
struct BuiltInAtomSignal

Public Members

MailboxMessage base
term atom
struct ConstAVMPack

Public Members

struct AVMPackData base
struct Context

Public Members

GlobalContext *global
Heap heap
term *e
term x[MAX_REG]
struct ListHead processes_list_head
struct ListHead processes_table_head
int32_t process_id
struct TimerListItem timer_list_head
struct ListHead monitors_head
avm_float_t *fr
size_t min_heap_size
size_t max_heap_size
unsigned long cp
Module *saved_module
const void *saved_ip
void *restore_trap_handler
Mailbox mailbox
struct ListHead dictionary
native_handler_f native_handler
uint64_t reductions
unsigned int leader
unsigned int has_min_heap_size
unsigned int has_max_heap_size
bool trap_exit
enum ContextFlags ATOMIC flags
void *platform_data
term group_leader
term bs
size_t bs_offset
term exit_reason
struct ContextAccumulator

Public Members

Context *ctx
term result
struct DictEntry

Public Members

struct ListHead head
term key
term value
struct ErlNifEnv

Public Members

GlobalContext *global
Heap heap
term *stack_pointer
term x[2]
struct ErlNifResourceTypeInit

Resource callbacks.

Members should be set to 0, 1 or 2 depending on provided callbacks. Callbacks can also be NULL if not used.

Public Members

int members
ErlNifResourceDtor *dtor
ErlNifResourceStop *stop
ErlNifResourceDown *down
struct ExportedFunction

Public Members

enum FunctionType type
struct FprintfFun

Public Members

PrinterFun base
FILE *stream
struct GlobalContext

Public Members

struct ListHead ready_processes
struct ListHead running_processes
struct ListHead waiting_processes
SpinLock processes_spinlock
struct SyncList refc_binaries
struct SyncList processes_table
struct SyncList registered_processes
struct SyncList listeners
struct SyncList resource_types
struct SyncList select_events
int32_t last_process_id
struct AtomsHashTable *atoms_table
struct ValuesHashTable *atoms_ids_table
struct AtomsHashTable *modules_table
RWLock *modules_lock
Module **modules_by_index
int loaded_modules_count
struct SyncList avmpack_data
struct TimerList timer_list
SpinLock timer_spinlock
unsigned long long ref_ticks
SpinLock ref_ticks_spinlock
int ATOMIC online_schedulers
int running_schedulers
bool ATOMIC waiting_scheduler
Mutex *schedulers_mutex
CondVar *schedulers_cv
bool ATOMIC scheduler_stop_all
SpinLock env_spinlock
void *platform_data
struct Heap

Public Members

HeapFragment *root
term *heap_start
term *heap_ptr
term *heap_end
struct HeapFragment

Public Members

HeapFragment *next
term mso_list
term *heap_end
union HeapFragment
term storage[]
struct HNode

Public Members

struct HNode *next
AtomString key
unsigned long value
unsigned long key
struct IFFRecord

Public Members

const char name[4]
uint32_t size
struct InMemoryAVMPack

Public Members

struct AVMPackData base
struct Int24

Public Members

int32_t val24
struct Int40

Public Members

int64_t val40
struct Int48

Public Members

int64_t val48
struct Int56

Public Members

int64_t val56
struct kv_pair

Public Members

term key
term value
struct LineRefOffset

Public Members

struct ListHead head
unsigned int offset
uint16_t line_ref
struct ListHead

Public Members

struct ListHead *next
struct ListHead *prev
struct LiteralEntry

Public Members

uint32_t size
void const *data
struct Mailbox

Public Members

MailboxMessage *ATOMIC outer_first
MailboxMessage *inner_first
MailboxMessage *inner_last
MailboxMessage *receive_pointer
MailboxMessage *receive_pointer_prev
struct MailboxMessage

Public Members

MailboxMessage *next
enum MessageType type
term *heap_fragment_end
union MailboxMessage
struct Message

Public Members

MailboxMessage base
term message
term *heap_end
term storage[]
struct Module

Public Members

GlobalContext *global
CodeChunk *code
void *export_table
void *local_table
void *atom_table
void *fun_table
void *str_table
size_t str_table_len
uint16_t *line_refs
struct ModuleFilename *filenames
struct ListHead line_ref_offsets
const struct ExportedFunction **imported_funcs
void **labels
void *literals_data
struct LiteralEntry *literals_table
int *local_atoms_to_global_table
void *module_platform_data
int module_index
int end_instruction_ii
unsigned int free_literals_data
Mutex *mutex
struct ModuleFilename

Public Members

uint8_t *data
size_t len
struct ModuleFunction

Public Members

struct ExportedFunction base
Module *target
int label
struct Monitor

A regular monitor or a half link.

Public Members

struct ListHead monitor_list_head
uint64_t ref_ticks
term monitor_obj
struct Nif

Public Members

struct ExportedFunction base
NifImpl nif_ptr
struct PrinterFun

Public Members

printer_function_t print
struct RefcBinary

Public Members

struct ListHead head
size_t ATOMIC ref_count
size_t size
struct ResourceType *resource_type
uint8_t data[]
struct RefcBinaryAVMPack

Public Members

struct AVMPackData base
struct RefcBinary *refc
struct RefSignal

Public Members

MailboxMessage base
uint64_t ref_ticks
struct RegisteredProcess

Public Members

struct ListHead registered_processes_list_head
int atom_index
int local_process_id
struct ResourceType

A resource type.

we need a reference to the global context as enif_release_resource needs to access the synchronized list of refc_binaries

Public Members

struct ListHead head
const char *name
GlobalContext *global
struct ListHead monitors
ErlNifResourceDtor *dtor
ErlNifResourceStop *stop
ErlNifResourceDown *down
struct SnprintfFun

Public Members

PrinterFun base
int size
char *buf
struct SelectEvent

A selectable event.

Public Members

struct ListHead head
ErlNifEvent event
struct RefcBinary *resource
bool read
bool write
bool undefined_ref
bool close
int32_t local_pid
uint64_t ref_ticks
struct SpinLock

Public Members

int ATOMIC lock
struct SyncList

Public Members

RWLock *lock
struct ListHead head
struct TempStack

Public Members

term *stack_end
term *stack_pos
int size
struct TermSignal

Public Members

MailboxMessage base
term signal_term
term *heap_end
term storage[]
struct TimerList

Public Members

struct ListHead head
int timers
uint64_t next_timer
struct TimerListItem

Public Members

uint64_t expiry_time
struct ListHead head
struct UnresolvedFunctionCall

Public Members

struct ExportedFunction base
int module_atom_index
int function_atom_index
int arity
struct ValuesHashTable

Public Members

int capacity
int count
RWLock *lock
struct HNode **buckets
enum BitstringFlags

Values:

enumerator LittleEndianInteger
enumerator SignedInteger
enumerator NativeEndianInteger
enumerator LittleEndianIntegerMask
enum ContextFlags

Values:

enumerator NoFlags
enumerator WaitingTimeout
enumerator WaitingTimeoutExpired
enumerator Running
enumerator Ready
enumerator Killed
enumerator Trap
enum DictionaryFunctionResult

Values:

enumerator DictionaryOk
enumerator DictionaryMemoryAllocFail
enum ErlNifResourceFlags

resource flags

Values:

enumerator ERL_NIF_RT_CREATE
enum ErlNifSelectFlags

enif_select mode flags

ERL_NIF_SELECT_CANCEL which was introduced with OTP-22, is unimplemented.

Values:

enumerator ERL_NIF_SELECT_READ
enumerator ERL_NIF_SELECT_WRITE
enumerator ERL_NIF_SELECT_STOP
enum ExternalTermOpts

Values:

enumerator ExternalTermNoOpts
enumerator ExternalTermToHeapFragment
enum ExternalTermResult

Values:

enumerator EXTERNAL_TERM_OK
enumerator EXTERNAL_TERM_BAD_ARG
enumerator EXTERNAL_TERM_MALLOC
enumerator EXTERNAL_TERM_HEAP_ALLOC
enum FunctionType

Values:

enumerator InvalidFunctionType
enumerator NIFFunctionType
enumerator UnresolvedFunctionCall
enumerator ModuleFunction
enumerator BIFFunctionType
enumerator GCBIFFunctionType
enum InteropFunctionResult

Values:

enumerator InteropOk
enumerator InteropMemoryAllocFail
enumerator InteropBadArg
enum MemoryAllocMode

Values:

enumerator MEMORY_NO_SHRINK
enumerator MEMORY_CAN_SHRINK
enumerator MEMORY_FORCE_SHRINK
enumerator MEMORY_NO_GC
enum MemoryGCResult

Values:

enumerator MEMORY_GC_OK
enumerator MEMORY_GC_ERROR_FAILED_ALLOCATION
enumerator MEMORY_GC_DENIED_ALLOCATION
enum MessageType

Values:

enumerator NormalMessage
enumerator KillSignal
enumerator GCSignal
enumerator ProcessInfoRequestSignal
enumerator TrapAnswerSignal
enumerator TrapExceptionSignal
enumerator FlushMonitorSignal
enumerator FlushInfoMonitorSignal
enum ModuleLoadResult

Values:

enumerator MODULE_LOAD_OK
enumerator MODULE_ERROR_FAILED_ALLOCATION
enum NativeHandlerResult

Values:

enumerator NativeTerminate
enumerator NativeContinue
enum RefcBinaryFlags

Values:

enumerator RefcNoFlags
enumerator RefcBinaryIsConst
enum TempStackResult

Values:

enumerator TempStackOk
enumerator TempStackFailedAlloc
enum TermCompareOpts

Values:

enumerator TermCompareNoOpts
enumerator TermCompareExact
enum TermCompareResult

Values:

enumerator TermCompareMemoryAllocFail
enumerator TermEquals
enumerator TermLessThan
enumerator TermGreaterThan