module.h

Include dependency graph for module.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "4" [label="atom.h" tooltip="atom.h"]
    "6" [label="atomshashtable.h" tooltip="atomshashtable.h"]
    "7" [label="context.h" tooltip="context.h"]
    "9" [label="erl_nif.h" tooltip="erl_nif.h"]
    "27" [label="exportedfunction.h" tooltip="exportedfunction.h"]
    "8" [label="globalcontext.h" tooltip="globalcontext.h"]
    "13" [label="list.h" tooltip="list.h"]
    "26" [label="mailbox.h" tooltip="mailbox.h"]
    "20" [label="memory.h" tooltip="memory.h"]
    "1" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/module.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/module.h" fillcolor="#BFBFBF"]
    "23" [label="refc_binary.h" tooltip="refc_binary.h"]
    "24" [label="resources.h" tooltip="resources.h"]
    "14" [label="smp.h" tooltip="smp.h"]
    "16" [label="synclist.h" tooltip="synclist.h"]
    "18" [label="term.h" tooltip="term.h"]
    "10" [label="term_typedef.h" tooltip="term_typedef.h"]
    "25" [label="timer_list.h" tooltip="timer_list.h"]
    "21" [label="utils.h" tooltip="utils.h"]
    "28" [label="valueshashtable.h" tooltip="valueshashtable.h"]
    "12" [label="inttypes.h" tooltip="inttypes.h"]
    "11" [label="limits.h" tooltip="limits.h"]
    "15" [label="stdatomic.h" tooltip="stdatomic.h"]
    "2" [label="stdbool.h" tooltip="stdbool.h"]
    "22" [label="stddef.h" tooltip="stddef.h"]
    "3" [label="stdint.h" tooltip="stdint.h"]
    "17" [label="stdio.h" tooltip="stdio.h"]
    "5" [label="stdlib.h" tooltip="stdlib.h"]
    "19" [label="string.h" tooltip="string.h"]
    "4" -> "3" [dir=forward tooltip="include"]
    "4" -> "5" [dir=forward tooltip="include"]
    "6" -> "4" [dir=forward tooltip="include"]
    "7" -> "8" [dir=forward tooltip="include"]
    "7" -> "13" [dir=forward tooltip="include"]
    "7" -> "26" [dir=forward tooltip="include"]
    "7" -> "14" [dir=forward tooltip="include"]
    "7" -> "18" [dir=forward tooltip="include"]
    "7" -> "25" [dir=forward tooltip="include"]
    "9" -> "10" [dir=forward tooltip="include"]
    "27" -> "18" [dir=forward tooltip="include"]
    "8" -> "3" [dir=forward tooltip="include"]
    "8" -> "4" [dir=forward tooltip="include"]
    "8" -> "9" [dir=forward tooltip="include"]
    "8" -> "13" [dir=forward tooltip="include"]
    "8" -> "14" [dir=forward tooltip="include"]
    "8" -> "16" [dir=forward tooltip="include"]
    "8" -> "18" [dir=forward tooltip="include"]
    "8" -> "25" [dir=forward tooltip="include"]
    "26" -> "2" [dir=forward tooltip="include"]
    "26" -> "13" [dir=forward tooltip="include"]
    "26" -> "14" [dir=forward tooltip="include"]
    "26" -> "10" [dir=forward tooltip="include"]
    "26" -> "21" [dir=forward tooltip="include"]
    "20" -> "9" [dir=forward tooltip="include"]
    "20" -> "10" [dir=forward tooltip="include"]
    "20" -> "21" [dir=forward tooltip="include"]
    "20" -> "3" [dir=forward tooltip="include"]
    "20" -> "5" [dir=forward tooltip="include"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "3" [dir=forward tooltip="include"]
    "1" -> "4" [dir=forward tooltip="include"]
    "1" -> "6" [dir=forward tooltip="include"]
    "1" -> "7" [dir=forward tooltip="include"]
    "1" -> "27" [dir=forward tooltip="include"]
    "1" -> "8" [dir=forward tooltip="include"]
    "1" -> "18" [dir=forward tooltip="include"]
    "1" -> "28" [dir=forward tooltip="include"]
    "23" -> "2" [dir=forward tooltip="include"]
    "23" -> "5" [dir=forward tooltip="include"]
    "23" -> "13" [dir=forward tooltip="include"]
    "23" -> "24" [dir=forward tooltip="include"]
    "23" -> "14" [dir=forward tooltip="include"]
    "24" -> "5" [dir=forward tooltip="include"]
    "24" -> "9" [dir=forward tooltip="include"]
    "24" -> "13" [dir=forward tooltip="include"]
    "14" -> "2" [dir=forward tooltip="include"]
    "14" -> "15" [dir=forward tooltip="include"]
    "16" -> "13" [dir=forward tooltip="include"]
    "16" -> "17" [dir=forward tooltip="include"]
    "16" -> "14" [dir=forward tooltip="include"]
    "18" -> "2" [dir=forward tooltip="include"]
    "18" -> "3" [dir=forward tooltip="include"]
    "18" -> "17" [dir=forward tooltip="include"]
    "18" -> "5" [dir=forward tooltip="include"]
    "18" -> "19" [dir=forward tooltip="include"]
    "18" -> "20" [dir=forward tooltip="include"]
    "18" -> "23" [dir=forward tooltip="include"]
    "18" -> "21" [dir=forward tooltip="include"]
    "18" -> "10" [dir=forward tooltip="include"]
    "10" -> "11" [dir=forward tooltip="include"]
    "10" -> "12" [dir=forward tooltip="include"]
    "10" -> "3" [dir=forward tooltip="include"]
    "25" -> "2" [dir=forward tooltip="include"]
    "25" -> "3" [dir=forward tooltip="include"]
    "25" -> "13" [dir=forward tooltip="include"]
    "21" -> "22" [dir=forward tooltip="include"]
}

This graph shows which files directly or indirectly include module.h:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "3" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/bif.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/bif.c"]
    "2" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/bif.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/bif.h"]
    "7" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/context.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/context.c"]
    "12" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/globalcontext.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/globalcontext.c"]
    "4" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/module.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/module.c"]
    "1" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/module.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/module.h" fillcolor="#BFBFBF"]
    "5" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/nifs.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/nifs.c"]
    "6" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/opcodesswitch.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/opcodesswitch.h"]
    "8" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/platform_nifs.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/platform_nifs.h"]
    "13" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/resources.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/resources.c"]
    "14" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/scheduler.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/scheduler.c"]
    "10" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/stacktrace.c" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/stacktrace.c"]
    "9" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/stacktrace.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/stacktrace.h"]
    "11" [label="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/sys.h" tooltip="/home/winford/github/UncleGrumpy/AtomVM/src/libAtomVM/sys.h"]
    "2" -> "3" [dir=back tooltip="include"]
    "2" -> "4" [dir=back tooltip="include"]
    "2" -> "5" [dir=back tooltip="include"]
    "2" -> "6" [dir=back tooltip="include"]
    "1" -> "2" [dir=back tooltip="include"]
    "1" -> "4" [dir=back tooltip="include"]
    "1" -> "5" [dir=back tooltip="include"]
    "1" -> "6" [dir=back tooltip="include"]
    "1" -> "8" [dir=back tooltip="include"]
    "1" -> "9" [dir=back tooltip="include"]
    "1" -> "11" [dir=back tooltip="include"]
    "6" -> "7" [dir=back tooltip="include"]
    "6" -> "4" [dir=back tooltip="include"]
    "8" -> "5" [dir=back tooltip="include"]
    "9" -> "6" [dir=back tooltip="include"]
    "9" -> "10" [dir=back tooltip="include"]
    "11" -> "7" [dir=back tooltip="include"]
    "11" -> "12" [dir=back tooltip="include"]
    "11" -> "4" [dir=back tooltip="include"]
    "11" -> "5" [dir=back tooltip="include"]
    "11" -> "13" [dir=back tooltip="include"]
    "11" -> "14" [dir=back tooltip="include"]
}

Defines

SMP_MODULE_LOCK(mod)
SMP_MODULE_UNLOCK(mod)

Enums

enum ModuleLoadResult

Values:

enumerator MODULE_LOAD_OK
enumerator MODULE_ERROR_FAILED_ALLOCATION

Functions

size_t module_get_exported_functions_count(Module *this_module)
uint32_t module_search_exported_function(Module *this_module, AtomString func_name, int func_arity)
static inline size_t module_get_exported_functions_list_size(Module *this_module)
term module_get_exported_functions(Module *this_module, Heap *heap, GlobalContext *global)
void module_destroy(Module *module)
Module *module_new_from_iff_binary(GlobalContext *global, const void *iff_binary, unsigned long size)
term module_load_literal(Module *mod, int index, Context *ctx)
static inline AtomString module_get_atom_string_by_id(const Module *mod, int local_atom_id)
static inline term module_get_atom_term_by_id(const Module *mod, int local_atom_id)
const struct ExportedFunction *module_resolve_function0(Module *mod, int import_table_index, struct UnresolvedFunctionCall *unresolved)
static inline term module_get_name(const Module *mod)
static inline const struct ExportedFunction *module_resolve_function(Module *mod, int import_table_index)
static inline term module_address(unsigned int module_index, unsigned int instruction_index)
static inline uint32_t module_get_fun_freeze(const Module *this_module, int fun_index)
static inline void module_get_fun(const Module *this_module, int fun_index, uint32_t *label, uint32_t *arity, uint32_t *n_freeze)
static inline const uint8_t *module_get_str(Module *mod, size_t offset, size_t *remaining)
bool module_get_function_from_label(Module *this_module, int label, AtomString *function_name, int *arity)
void module_insert_line_ref_offset(Module *mod, int line_ref, int offset)
int module_find_line(Module *mod, unsigned int offset)
static inline bool module_has_line_chunk(Module *mod)
__attribute__

Public Members

char magic[4]
uint32_t size
uint32_t info_size
uint32_t version
uint32_t opcode_max
uint32_t labels
uint32_t functions_count
uint8_t code[1]
struct LiteralEntry

Public Members

uint32_t size
void const *data
struct ModuleFilename

Public Members

uint8_t *data
size_t len
struct LineRefOffset

Collaboration diagram for LineRefOffset:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "1" [label="LineRefOffset" tooltip="LineRefOffset" fillcolor="#BFBFBF"]
    "2" [label="ListHead" tooltip="ListHead"]
    "1" -> "2" [dir=forward tooltip="usage"]
    "2" -> "2" [dir=forward tooltip="usage"]
}

Public Members

struct ListHead head
unsigned int offset
uint16_t line_ref
struct Module

Collaboration diagram for Module:

digraph {
    graph [bgcolor="#00000000"]
    node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
    edge [color="#1414CE"]
    "6" [label="AtomsHashTable" tooltip="AtomsHashTable"]
    "11" [label="ExportedFunction" tooltip="ExportedFunction"]
    "2" [label="GlobalContext" tooltip="GlobalContext"]
    "7" [label="HNode" tooltip="HNode"]
    "3" [label="ListHead" tooltip="ListHead"]
    "12" [label="LiteralEntry" tooltip="LiteralEntry"]
    "1" [label="Module" tooltip="Module" fillcolor="#BFBFBF"]
    "10" [label="ModuleFilename" tooltip="ModuleFilename"]
    "4" [label="SpinLock" tooltip="SpinLock"]
    "5" [label="SyncList" tooltip="SyncList"]
    "9" [label="TimerList" tooltip="TimerList"]
    "8" [label="ValuesHashTable" tooltip="ValuesHashTable"]
    "6" -> "7" [dir=forward tooltip="usage"]
    "2" -> "3" [dir=forward tooltip="usage"]
    "2" -> "4" [dir=forward tooltip="usage"]
    "2" -> "5" [dir=forward tooltip="usage"]
    "2" -> "6" [dir=forward tooltip="usage"]
    "2" -> "8" [dir=forward tooltip="usage"]
    "2" -> "1" [dir=forward tooltip="usage"]
    "2" -> "9" [dir=forward tooltip="usage"]
    "7" -> "7" [dir=forward tooltip="usage"]
    "3" -> "3" [dir=forward tooltip="usage"]
    "1" -> "2" [dir=forward tooltip="usage"]
    "1" -> "10" [dir=forward tooltip="usage"]
    "1" -> "3" [dir=forward tooltip="usage"]
    "1" -> "11" [dir=forward tooltip="usage"]
    "1" -> "12" [dir=forward tooltip="usage"]
    "5" -> "3" [dir=forward tooltip="usage"]
    "9" -> "3" [dir=forward tooltip="usage"]
    "8" -> "7" [dir=forward tooltip="usage"]
}

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