Skip to content

Commit bca4c4f

Browse files
committed
ets: remove prefix from internal functions
Signed-off-by: Jakub Gonet <jakub.gonet@swmansion.com>
1 parent 98acad0 commit bca4c4f

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/libAtomVM/ets.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ typedef enum TableAccessType
7676
TableAccessWrite
7777
} TableAccessType;
7878

79-
static void ets_delete_all_tables(struct Ets *ets, GlobalContext *global);
79+
static void delete_all_tables(struct Ets *ets, GlobalContext *global);
8080

8181
static void ets_add_table(struct Ets *ets, struct EtsTable *ets_table)
8282
{
@@ -87,7 +87,7 @@ static void ets_add_table(struct Ets *ets, struct EtsTable *ets_table)
8787
synclist_unlock(&ets->ets_tables);
8888
}
8989

90-
static struct EtsTable *ets_acquire_table(struct Ets *ets, int32_t process_id, term name_or_ref, TableAccessType requested_access_type)
90+
static struct EtsTable *acquire_table(struct Ets *ets, int32_t process_id, term name_or_ref, TableAccessType requested_access_type)
9191
{
9292
uint64_t ref = 0;
9393
term name = term_invalid_term();
@@ -135,14 +135,14 @@ void ets_init(struct Ets *ets)
135135

136136
void ets_destroy(struct Ets *ets, GlobalContext *global)
137137
{
138-
ets_delete_all_tables(ets, global);
138+
delete_all_tables(ets, global);
139139
synclist_destroy(&ets->ets_tables);
140140
}
141141

142142
EtsErrorCode ets_create_table_maybe_gc(term name, bool is_named, EtsTableType table_type, EtsAccessType access_type, size_t keypos, term *ret, Context *ctx)
143143
{
144144
if (is_named) {
145-
struct EtsTable *ets_table = ets_acquire_table(&ctx->global->ets, ETS_ANY_PROCESS, name, TableAccessNone);
145+
struct EtsTable *ets_table = acquire_table(&ctx->global->ets, ETS_ANY_PROCESS, name, TableAccessNone);
146146
if (ets_table != NULL) {
147147
return EtsTableNameInUse;
148148
}
@@ -209,7 +209,7 @@ static void ets_table_destroy(struct EtsTable *table, GlobalContext *global)
209209

210210
typedef bool (*ets_table_filter_pred)(struct EtsTable *table, void *data);
211211

212-
static void ets_delete_tables_internal(struct Ets *ets, ets_table_filter_pred pred, void *data, GlobalContext *global)
212+
static void delete_tables_pred(struct Ets *ets, ets_table_filter_pred pred, void *data, GlobalContext *global)
213213
{
214214
struct ListHead *ets_tables_list = synclist_wrlock(&ets->ets_tables);
215215
struct ListHead *item;
@@ -232,7 +232,7 @@ static bool equal_process_id_pred(struct EtsTable *table, void *data)
232232

233233
void ets_delete_owned_tables(struct Ets *ets, int32_t process_id, GlobalContext *global)
234234
{
235-
ets_delete_tables_internal(ets, equal_process_id_pred, &process_id, global);
235+
delete_tables_pred(ets, equal_process_id_pred, &process_id, global);
236236
}
237237

238238
static bool true_pred(struct EtsTable *table, void *data)
@@ -243,9 +243,9 @@ static bool true_pred(struct EtsTable *table, void *data)
243243
return true;
244244
}
245245

246-
static void ets_delete_all_tables(struct Ets *ets, GlobalContext *global)
246+
static void delete_all_tables(struct Ets *ets, GlobalContext *global)
247247
{
248-
ets_delete_tables_internal(ets, true_pred, NULL, global);
248+
delete_tables_pred(ets, true_pred, NULL, global);
249249
}
250250

251251
static inline bool has_key_at(term tuple, size_t key_index)
@@ -351,7 +351,7 @@ static EtsErrorCode insert_tuple_list(struct EtsTable *ets_table, term list, Glo
351351

352352
EtsErrorCode ets_insert(term name_or_ref, term entry, Context *ctx)
353353
{
354-
struct EtsTable *ets_table = ets_acquire_table(&ctx->global->ets, ctx->process_id, name_or_ref, TableAccessWrite);
354+
struct EtsTable *ets_table = acquire_table(&ctx->global->ets, ctx->process_id, name_or_ref, TableAccessWrite);
355355
if (IS_NULL_PTR(ets_table)) {
356356
return EtsBadAccess;
357357
}
@@ -425,7 +425,7 @@ static EtsErrorCode lookup_maybe_gc(struct EtsTable *ets_table, term key, size_t
425425

426426
EtsErrorCode ets_lookup_maybe_gc(term name_or_ref, term key, term *ret, Context *ctx)
427427
{
428-
struct EtsTable *ets_table = ets_acquire_table(&ctx->global->ets, ctx->process_id, name_or_ref, TableAccessRead);
428+
struct EtsTable *ets_table = acquire_table(&ctx->global->ets, ctx->process_id, name_or_ref, TableAccessRead);
429429
if (IS_NULL_PTR(ets_table)) {
430430
return EtsBadAccess;
431431
}
@@ -438,7 +438,7 @@ EtsErrorCode ets_lookup_maybe_gc(term name_or_ref, term key, term *ret, Context
438438

439439
EtsErrorCode ets_lookup_element_maybe_gc(term name_or_ref, term key, size_t key_index, term *ret, Context *ctx)
440440
{
441-
struct EtsTable *ets_table = ets_acquire_table(&ctx->global->ets, ctx->process_id, name_or_ref, TableAccessRead);
441+
struct EtsTable *ets_table = acquire_table(&ctx->global->ets, ctx->process_id, name_or_ref, TableAccessRead);
442442
if (IS_NULL_PTR(ets_table)) {
443443
return EtsBadAccess;
444444
}
@@ -462,7 +462,7 @@ EtsErrorCode ets_lookup_element_maybe_gc(term name_or_ref, term key, size_t key_
462462

463463
EtsErrorCode ets_drop_table(term name_or_ref, term *ret, Context *ctx)
464464
{
465-
struct EtsTable *ets_table = ets_acquire_table(&ctx->global->ets, ctx->process_id, name_or_ref, TableAccessWrite);
465+
struct EtsTable *ets_table = acquire_table(&ctx->global->ets, ctx->process_id, name_or_ref, TableAccessWrite);
466466
if (IS_NULL_PTR(ets_table)) {
467467
return EtsBadAccess;
468468
}
@@ -480,7 +480,7 @@ EtsErrorCode ets_drop_table(term name_or_ref, term *ret, Context *ctx)
480480

481481
EtsErrorCode ets_delete(term name_or_ref, term key, term *ret, Context *ctx)
482482
{
483-
struct EtsTable *ets_table = ets_acquire_table(&ctx->global->ets, ctx->process_id, name_or_ref, TableAccessWrite);
483+
struct EtsTable *ets_table = acquire_table(&ctx->global->ets, ctx->process_id, name_or_ref, TableAccessWrite);
484484
if (IS_NULL_PTR(ets_table)) {
485485
return EtsBadAccess;
486486
}
@@ -540,7 +540,7 @@ static bool operation_to_tuple4(term operation, size_t default_pos, term *positi
540540

541541
EtsErrorCode ets_update_counter_maybe_gc(term ref, term key, term operation, term default_value, term *ret, Context *ctx)
542542
{
543-
struct EtsTable *ets_table = ets_acquire_table(&ctx->global->ets, ctx->process_id, ref, TableAccessWrite);
543+
struct EtsTable *ets_table = acquire_table(&ctx->global->ets, ctx->process_id, ref, TableAccessWrite);
544544
if (IS_NULL_PTR(ets_table)) {
545545
return EtsBadAccess;
546546
}

0 commit comments

Comments
 (0)