ets.c

Include dependency graph for ets.c:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "5" [label="atom.h" tooltip="atom.h"] "7" [label="atom_table.h" tooltip="atom_table.h"] "32" [label="bitstring.h" tooltip="bitstring.h"] "3" [label="context.h" tooltip="context.h"] "35" [label="defaultatoms.h" tooltip="defaultatoms.h"] "13" [label="erl_nif.h" tooltip="erl_nif.h"] "1" [label="/__w/AtomVM/AtomVM/src/libAtomVM/ets.c" tooltip="/__w/AtomVM/AtomVM/src/libAtomVM/ets.c" fillcolor="#BFBFBF"] "17" [label="ets.h" tooltip="ets.h"] "38" [label="ets_multimap.h" tooltip="ets_multimap.h"] "34" [label="exportedfunction.h" tooltip="exportedfunction.h"] "4" [label="globalcontext.h" tooltip="globalcontext.h"] "24" [label="intn.h" tooltip="intn.h"] "31" [label="jit.h" tooltip="jit.h"] "19" [label="list.h" tooltip="list.h"] "28" [label="mailbox.h" tooltip="mailbox.h"] "25" [label="memory.h" tooltip="memory.h"] "37" [label="overflow_helpers.h" tooltip="overflow_helpers.h"] "26" [label="refc_binary.h" tooltip="refc_binary.h"] "27" [label="resources.h" tooltip="resources.h"] "20" [label="smp.h" tooltip="smp.h"] "18" [label="synclist.h" tooltip="synclist.h"] "21" [label="term.h" tooltip="term.h"] "14" [label="term_typedef.h" tooltip="term_typedef.h"] "29" [label="timer_list.h" tooltip="timer_list.h"] "33" [label="unicode.h" tooltip="unicode.h"] "9" [label="utils.h" tooltip="utils.h"] "30" [label="valueshashtable.h" tooltip="valueshashtable.h"] "15" [label="assert.h" tooltip="assert.h"] "36" [label="defaultatoms.def" tooltip="defaultatoms.def"] "10" [label="inttypes.h" tooltip="inttypes.h"] "16" [label="limits.h" tooltip="limits.h"] "8" [label="stdbool.h" tooltip="stdbool.h"] "11" [label="stddef.h" tooltip="stddef.h"] "2" [label="stdint.h" tooltip="stdint.h"] "12" [label="stdio.h" tooltip="stdio.h"] "6" [label="stdlib.h" tooltip="stdlib.h"] "23" [label="string.h" tooltip="string.h"] "22" [label="sys/types.h" tooltip="sys/types.h"] "5" -> "2" [dir=forward tooltip="include"] "5" -> "6" [dir=forward tooltip="include"] "7" -> "8" [dir=forward tooltip="include"] "7" -> "5" [dir=forward tooltip="include"] "7" -> "9" [dir=forward tooltip="include"] "32" -> "24" [dir=forward tooltip="include"] "32" -> "21" [dir=forward tooltip="include"] "32" -> "33" [dir=forward tooltip="include"] "32" -> "8" [dir=forward tooltip="include"] "32" -> "2" [dir=forward tooltip="include"] "3" -> "4" [dir=forward tooltip="include"] "3" -> "31" [dir=forward tooltip="include"] "3" -> "19" [dir=forward tooltip="include"] "3" -> "28" [dir=forward tooltip="include"] "3" -> "20" [dir=forward tooltip="include"] "3" -> "21" [dir=forward tooltip="include"] "3" -> "29" [dir=forward tooltip="include"] "35" -> "4" [dir=forward tooltip="include"] "35" -> "36" [dir=forward tooltip="include"] "13" -> "14" [dir=forward tooltip="include"] "1" -> "2" [dir=forward tooltip="include"] "1" -> "3" [dir=forward tooltip="include"] "1" -> "35" [dir=forward tooltip="include"] "1" -> "19" [dir=forward tooltip="include"] "1" -> "25" [dir=forward tooltip="include"] "1" -> "37" [dir=forward tooltip="include"] "1" -> "21" [dir=forward tooltip="include"] "1" -> "9" [dir=forward tooltip="include"] "1" -> "17" [dir=forward tooltip="include"] "1" -> "38" [dir=forward tooltip="include"] "1" -> "20" [dir=forward tooltip="include"] "17" -> "8" [dir=forward tooltip="include"] "17" -> "18" [dir=forward tooltip="include"] "17" -> "21" [dir=forward tooltip="include"] "38" -> "4" [dir=forward tooltip="include"] "38" -> "21" [dir=forward tooltip="include"] "34" -> "21" [dir=forward tooltip="include"] "4" -> "2" [dir=forward tooltip="include"] "4" -> "5" [dir=forward tooltip="include"] "4" -> "7" [dir=forward tooltip="include"] "4" -> "13" [dir=forward tooltip="include"] "4" -> "17" [dir=forward tooltip="include"] "4" -> "19" [dir=forward tooltip="include"] "4" -> "28" [dir=forward tooltip="include"] "4" -> "20" [dir=forward tooltip="include"] "4" -> "18" [dir=forward tooltip="include"] "4" -> "21" [dir=forward tooltip="include"] "4" -> "29" [dir=forward tooltip="include"] "4" -> "30" [dir=forward tooltip="include"] "24" -> "8" [dir=forward tooltip="include"] "24" -> "23" [dir=forward tooltip="include"] "24" -> "9" [dir=forward tooltip="include"] "31" -> "32" [dir=forward tooltip="include"] "31" -> "34" [dir=forward tooltip="include"] "31" -> "21" [dir=forward tooltip="include"] "31" -> "14" [dir=forward tooltip="include"] "31" -> "8" [dir=forward tooltip="include"] "19" -> "8" [dir=forward tooltip="include"] "28" -> "8" [dir=forward tooltip="include"] "28" -> "19" [dir=forward tooltip="include"] "28" -> "14" [dir=forward tooltip="include"] "28" -> "9" [dir=forward tooltip="include"] "25" -> "2" [dir=forward tooltip="include"] "25" -> "6" [dir=forward tooltip="include"] "25" -> "13" [dir=forward tooltip="include"] "25" -> "14" [dir=forward tooltip="include"] "25" -> "9" [dir=forward tooltip="include"] "37" -> "21" [dir=forward tooltip="include"] "37" -> "2" [dir=forward tooltip="include"] "26" -> "8" [dir=forward tooltip="include"] "26" -> "6" [dir=forward tooltip="include"] "26" -> "19" [dir=forward tooltip="include"] "26" -> "27" [dir=forward tooltip="include"] "27" -> "6" [dir=forward tooltip="include"] "27" -> "13" [dir=forward tooltip="include"] "27" -> "19" [dir=forward tooltip="include"] "27" -> "28" [dir=forward tooltip="include"] "27" -> "25" [dir=forward tooltip="include"] "27" -> "18" [dir=forward tooltip="include"] "20" -> "8" [dir=forward tooltip="include"] "18" -> "12" [dir=forward tooltip="include"] "18" -> "19" [dir=forward tooltip="include"] "18" -> "20" [dir=forward tooltip="include"] "21" -> "22" [dir=forward tooltip="include"] "21" -> "8" [dir=forward tooltip="include"] "21" -> "2" [dir=forward tooltip="include"] "21" -> "12" [dir=forward tooltip="include"] "21" -> "6" [dir=forward tooltip="include"] "21" -> "23" [dir=forward tooltip="include"] "21" -> "5" [dir=forward tooltip="include"] "21" -> "24" [dir=forward tooltip="include"] "21" -> "25" [dir=forward tooltip="include"] "21" -> "26" [dir=forward tooltip="include"] "21" -> "27" [dir=forward tooltip="include"] "21" -> "9" [dir=forward tooltip="include"] "21" -> "14" [dir=forward tooltip="include"] "14" -> "15" [dir=forward tooltip="include"] "14" -> "16" [dir=forward tooltip="include"] "14" -> "10" [dir=forward tooltip="include"] "14" -> "2" [dir=forward tooltip="include"] "29" -> "8" [dir=forward tooltip="include"] "29" -> "2" [dir=forward tooltip="include"] "29" -> "19" [dir=forward tooltip="include"] "33" -> "8" [dir=forward tooltip="include"] "33" -> "11" [dir=forward tooltip="include"] "33" -> "2" [dir=forward tooltip="include"] "9" -> "10" [dir=forward tooltip="include"] "9" -> "8" [dir=forward tooltip="include"] "9" -> "11" [dir=forward tooltip="include"] "9" -> "12" [dir=forward tooltip="include"] "9" -> "6" [dir=forward tooltip="include"] "30" -> "11" [dir=forward tooltip="include"] "30" -> "2" [dir=forward tooltip="include"] }

Defines

ETS_ANY_PROCESS -1
ETS_WHOLE_TUPLE SIZE_MAX
SMP_RDLOCK(table) smp_rwlock_rdlock(table->lock)
SMP_WRLOCK(table) smp_rwlock_wrlock(table->lock)
SMP_UNLOCK(table) smp_rwlock_unlock(table->lock)

Typedefs

typedef enum TableAccess TableAccess

Enums

enum TableAccess

Values:

enumerator TableAccessNone
enumerator TableAccessRead
enumerator TableAccessWrite

Functions

static struct EtsTable *get_table(Ets *ets, term name_or_ref, int32_t process_id, TableAccess access)
static ets_result_t add_table(Ets *ets, struct EtsTable *table)
static void delete_all_tables(Ets *ets, GlobalContext *global)
static void table_destroy(struct EtsTable *table, GlobalContext *global)
static ets_result_t insert_one(struct EtsTable *table, term tuple, bool as_new, Context *ctx)
static ets_result_t insert_many(struct EtsTable *table, term tuples, bool as_new, Context *ctx)
static ets_result_t lookup_select_maybe_gc(struct EtsTable *table, term key, size_t index, size_t num_roots, term *roots, term *ret, Context *ctx)
static ets_result_t lookup_or_default(struct EtsTable *table, term key, term default_tuple, Heap *ret_heap, term *ret, Context *ctx)
static ets_result_t apply_spec(term tuple, term spec, size_t key_index)
static ets_result_t apply_op(term tuple, term opt, avm_int_t *ret, size_t key_index)
void ets_init(Ets *ets)
void ets_destroy(Ets *ets, GlobalContext *global)
ets_result_t ets_create_table_maybe_gc(term name, bool named, ets_table_type_t type, ets_table_access_t access, size_t key_index, term *ret, Context *ctx)
ets_result_t ets_lookup_maybe_gc(term name_or_ref, term key, term *ret, Context *ctx)
ets_result_t ets_lookup_element_maybe_gc(term name_or_ref, term key, size_t index, term *ret, Context *ctx)
ets_result_t ets_member(term name_or_ref, term key, Context *ctx)
ets_result_t ets_insert(term name_or_ref, term entry, bool as_new, Context *ctx)
ets_result_t ets_update_element(term name_or_ref, term key, term element_spec, term default_tuple, Context *ctx)
ets_result_t ets_update_counter_maybe_gc(term name_or_ref, term key, term op, term default_tuple, term *ret, Context *ctx)
ets_result_t ets_take_maybe_gc(term name_or_ref, term key, term *ret, Context *ctx)
ets_result_t ets_delete(term name_or_ref, term key, Context *ctx)
ets_result_t ets_delete_table(term name_or_ref, Context *ctx)
ets_result_t ets_delete_object(term name_or_ref, term tuple, Context *ctx)
void ets_delete_owned_tables(Ets *ets, int32_t process_id, GlobalContext *global)
struct EtsTable

Collaboration diagram for EtsTable:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "3" [label="EtsMultimap" tooltip="EtsMultimap"] "5" [label="EtsMultimapEntry" tooltip="EtsMultimapEntry"] "4" [label="EtsMultimapNode" tooltip="EtsMultimapNode"] "1" [label="EtsTable" tooltip="EtsTable" fillcolor="#BFBFBF"] "6" [label="Heap" tooltip="Heap"] "7" [label="HeapFragment" tooltip="HeapFragment"] "2" [label="ListHead" tooltip="ListHead"] "3" -> "4" [dir=forward tooltip="usage"] "5" -> "5" [dir=forward tooltip="usage"] "5" -> "6" [dir=forward tooltip="usage"] "4" -> "4" [dir=forward tooltip="usage"] "4" -> "5" [dir=forward tooltip="usage"] "1" -> "2" [dir=forward tooltip="usage"] "1" -> "3" [dir=forward tooltip="usage"] "6" -> "7" [dir=forward tooltip="usage"] "7" -> "7" [dir=forward tooltip="usage"] "2" -> "2" [dir=forward tooltip="usage"] }

Public Members

struct ListHead head
term name
bool named
size_t key_index
ets_table_type_t type
ets_table_access_t access
EtsMultimap *multimap
int32_t owner_process_id
uint64_t ref_ticks
RWLock *lock