atom_table.c
Include dependency graph for atom_table.c:
Defines
-
SMP_RDLOCK(htable) smp_rwlock_rdlock(htable->lock)
-
SMP_WRLOCK(htable) smp_rwlock_wrlock(htable->lock)
-
SMP_UNLOCK(htable) smp_rwlock_unlock(htable->lock)
-
DEFAULT_SIZE 8
-
CAPACITY_INCREASE 8
-
MAX_ATOM_LEN ((1 << 12) - 1)
-
ATOM_TABLE_THRESHOLD(capacity) (capacity + (capacity >> 2))
-
ATOM_TABLE_NEW_CAPACITY(new_count) (new_count + CAPACITY_INCREASE)
-
ATOM_TABLE_NOT_FOUND_MARKER ((atom_index_t) -1)
Functions
-
static struct HNodeGroup *new_node_group(struct AtomTable *table, int len)
-
static unsigned long sdbm_hash(const unsigned char *str, int len)
-
static inline struct HNode *get_node_from_bucket(const struct AtomTable *hash_table, unsigned long bucket_index, const uint8_t *string, size_t string_len)
-
static inline struct HNode *get_node_with_hash(const struct AtomTable *hash_table, const uint8_t *string, size_t string_len, unsigned long hash)
-
static inline struct HNode *get_node(const struct AtomTable *hash_table, const uint8_t *string, size_t string_len)
-
const uint8_t *atom_table_get_atom_string(struct AtomTable *table, atom_index_t index, size_t *out_size)
Get a pointer to the character data of a given atom.
returned pointer is not null terminated
- Parameters:
table – atom table
atom_index – index of the atom to get the representation of
out_len – on output, size of the character data
-
bool atom_table_is_equal_to_atom_string(struct AtomTable *table, atom_index_t t_atom_index, AtomString string)
-
int atom_table_cmp_using_atom_index(struct AtomTable *table, atom_index_t t_atom_index, atom_index_t other_atom_index)
-
atom_ref_t atom_table_get_atom_ptr_and_len(struct AtomTable *table, atom_index_t index, size_t *out_len)
-
static inline void init_node(struct HNode *node, const uint8_t *atom_data, size_t atom_len, long index)
-
static inline void insert_node_into_bucket(struct AtomTable *table, int bucket_index, struct HNode *node)
-
static inline atom_index_t insert_node(struct AtomTable *table, struct HNodeGroup *node_group, unsigned long bucket_index, const uint8_t *atom_data, size_t atom_len)
-
enum AtomTableEnsureAtomResult atom_table_ensure_atom(struct AtomTable *table, const uint8_t *atom_data, size_t atom_len, enum AtomTableCopyOpt opts, atom_index_t *result)
-
static inline int read_encoded_len(const uint8_t **len_bytes)
-
struct HNode
Collaboration diagram for HNode:
-
struct HNodeGroup
Collaboration diagram for HNodeGroup: