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"]
    "4" [label="stdbool.h" tooltip="stdbool.h"]
    "24" [label="atom.h" tooltip="atom.h"]
    "15" [label="assert.h" tooltip="assert.h"]
    "5" [label="synclist.h" tooltip="synclist.h"]
    "28" [label="defaultatoms.h" tooltip="defaultatoms.h"]
    "9" [label="stdint.h" tooltip="stdint.h"]
    "10" [label="stdlib.h" tooltip="stdlib.h"]
    "22" [label="context.h" tooltip="context.h"]
    "18" [label="utils.h" tooltip="utils.h"]
    "1" [label="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/ets.c" tooltip="/home/runner/work/AtomVM/AtomVM/src/libAtomVM/ets.c" fillcolor="#BFBFBF"]
    "2" [label="ets.h" tooltip="ets.h"]
    "25" [label="atom_table.h" tooltip="atom_table.h"]
    "14" [label="term_typedef.h" tooltip="term_typedef.h"]
    "19" [label="stddef.h" tooltip="stddef.h"]
    "16" [label="limits.h" tooltip="limits.h"]
    "20" [label="refc_binary.h" tooltip="refc_binary.h"]
    "11" [label="string.h" tooltip="string.h"]
    "26" [label="mailbox.h" tooltip="mailbox.h"]
    "8" [label="term.h" tooltip="term.h"]
    "13" [label="erl_nif.h" tooltip="erl_nif.h"]
    "21" [label="resources.h" tooltip="resources.h"]
    "7" [label="smp.h" tooltip="smp.h"]
    "29" [label="ets_hashtable.h" tooltip="ets_hashtable.h"]
    "23" [label="globalcontext.h" tooltip="globalcontext.h"]
    "12" [label="memory.h" tooltip="memory.h"]
    "6" [label="stdio.h" tooltip="stdio.h"]
    "27" [label="timer_list.h" tooltip="timer_list.h"]
    "17" [label="inttypes.h" tooltip="inttypes.h"]
    "3" [label="list.h" tooltip="list.h"]
    "24" -> "9" [dir=forward tooltip="include"]
    "24" -> "10" [dir=forward tooltip="include"]
    "5" -> "6" [dir=forward tooltip="include"]
    "5" -> "3" [dir=forward tooltip="include"]
    "5" -> "7" [dir=forward tooltip="include"]
    "28" -> "23" [dir=forward tooltip="include"]
    "22" -> "23" [dir=forward tooltip="include"]
    "22" -> "3" [dir=forward tooltip="include"]
    "22" -> "26" [dir=forward tooltip="include"]
    "22" -> "7" [dir=forward tooltip="include"]
    "22" -> "8" [dir=forward tooltip="include"]
    "22" -> "27" [dir=forward tooltip="include"]
    "18" -> "19" [dir=forward tooltip="include"]
    "18" -> "6" [dir=forward tooltip="include"]
    "18" -> "10" [dir=forward tooltip="include"]
    "1" -> "2" [dir=forward tooltip="include"]
    "1" -> "22" [dir=forward tooltip="include"]
    "1" -> "28" [dir=forward tooltip="include"]
    "1" -> "29" [dir=forward tooltip="include"]
    "1" -> "3" [dir=forward tooltip="include"]
    "1" -> "12" [dir=forward tooltip="include"]
    "1" -> "8" [dir=forward tooltip="include"]
    "2" -> "3" [dir=forward tooltip="include"]
    "2" -> "5" [dir=forward tooltip="include"]
    "2" -> "8" [dir=forward tooltip="include"]
    "25" -> "4" [dir=forward tooltip="include"]
    "25" -> "24" [dir=forward tooltip="include"]
    "14" -> "15" [dir=forward tooltip="include"]
    "14" -> "16" [dir=forward tooltip="include"]
    "14" -> "17" [dir=forward tooltip="include"]
    "14" -> "9" [dir=forward tooltip="include"]
    "20" -> "4" [dir=forward tooltip="include"]
    "20" -> "10" [dir=forward tooltip="include"]
    "20" -> "3" [dir=forward tooltip="include"]
    "20" -> "21" [dir=forward tooltip="include"]
    "26" -> "4" [dir=forward tooltip="include"]
    "26" -> "3" [dir=forward tooltip="include"]
    "26" -> "14" [dir=forward tooltip="include"]
    "26" -> "18" [dir=forward tooltip="include"]
    "8" -> "4" [dir=forward tooltip="include"]
    "8" -> "9" [dir=forward tooltip="include"]
    "8" -> "6" [dir=forward tooltip="include"]
    "8" -> "10" [dir=forward tooltip="include"]
    "8" -> "11" [dir=forward tooltip="include"]
    "8" -> "12" [dir=forward tooltip="include"]
    "8" -> "20" [dir=forward tooltip="include"]
    "8" -> "18" [dir=forward tooltip="include"]
    "8" -> "14" [dir=forward tooltip="include"]
    "13" -> "14" [dir=forward tooltip="include"]
    "21" -> "10" [dir=forward tooltip="include"]
    "21" -> "13" [dir=forward tooltip="include"]
    "21" -> "3" [dir=forward tooltip="include"]
    "21" -> "12" [dir=forward tooltip="include"]
    "7" -> "4" [dir=forward tooltip="include"]
    "29" -> "23" [dir=forward tooltip="include"]
    "29" -> "8" [dir=forward tooltip="include"]
    "29" -> "10" [dir=forward tooltip="include"]
    "23" -> "9" [dir=forward tooltip="include"]
    "23" -> "24" [dir=forward tooltip="include"]
    "23" -> "25" [dir=forward tooltip="include"]
    "23" -> "13" [dir=forward tooltip="include"]
    "23" -> "2" [dir=forward tooltip="include"]
    "23" -> "3" [dir=forward tooltip="include"]
    "23" -> "26" [dir=forward tooltip="include"]
    "23" -> "7" [dir=forward tooltip="include"]
    "23" -> "5" [dir=forward tooltip="include"]
    "23" -> "8" [dir=forward tooltip="include"]
    "23" -> "27" [dir=forward tooltip="include"]
    "12" -> "9" [dir=forward tooltip="include"]
    "12" -> "10" [dir=forward tooltip="include"]
    "12" -> "13" [dir=forward tooltip="include"]
    "12" -> "14" [dir=forward tooltip="include"]
    "12" -> "18" [dir=forward tooltip="include"]
    "27" -> "4" [dir=forward tooltip="include"]
    "27" -> "9" [dir=forward tooltip="include"]
    "27" -> "3" [dir=forward tooltip="include"]
    "3" -> "4" [dir=forward tooltip="include"]
}

Defines

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 TableAccessType TableAccessType
typedef bool (*ets_table_filter_pred)(struct EtsTable *table, void *data)

Enums

enum TableAccessType

Values:

enumerator TableAccessNone
enumerator TableAccessRead
enumerator TableAccessWrite

Functions

static void ets_delete_all_tables(struct Ets *ets, GlobalContext *global)
static void ets_add_table(struct Ets *ets, struct EtsTable *ets_table)
static struct EtsTable *ets_get_table_by_ref(struct Ets *ets, uint64_t ref, TableAccessType access_type)
static struct EtsTable *ets_get_table_by_name(struct Ets *ets, term name, TableAccessType access_type)
void ets_init(struct Ets *ets)
void ets_destroy(struct Ets *ets, GlobalContext *global)
EtsErrorCode ets_create_table(term name, bool is_named, EtsTableType table_type, EtsAccessType access_type, size_t keypos, term *ret, Context *ctx)
static void ets_table_destroy(struct EtsTable *table, GlobalContext *global)
static void ets_delete_tables_internal(struct Ets *ets, ets_table_filter_pred pred, void *data, GlobalContext *global)
static bool equal_process_id_pred(struct EtsTable *table, void *data)
void ets_delete_owned_tables(struct Ets *ets, int32_t process_id, GlobalContext *global)
static bool true_pred(struct EtsTable *table, void *data)
EtsErrorCode ets_insert(term ref, term entry, Context *ctx)
EtsErrorCode ets_lookup(term ref, term key, term *ret, Context *ctx)
EtsErrorCode ets_lookup_element(term ref, term key, size_t pos, term *ret, Context *ctx)
EtsErrorCode ets_delete(term ref, term key, term *ret, Context *ctx)
struct EtsTable

Collaboration diagram for EtsTable:

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

Public Members

struct ListHead head
uint64_t ref_ticks
term name
bool is_named
int32_t owner_process_id
size_t keypos
EtsTableType table_type
struct EtsHashTable *hashtable
EtsAccessType access_type
RWLock *lock