@@ -76,7 +76,7 @@ typedef enum TableAccessType
76
76
TableAccessWrite
77
77
} TableAccessType ;
78
78
79
- static void ets_delete_all_tables (struct Ets * ets , GlobalContext * global );
79
+ static void delete_all_tables (struct Ets * ets , GlobalContext * global );
80
80
81
81
static void ets_add_table (struct Ets * ets , struct EtsTable * ets_table )
82
82
{
@@ -87,7 +87,7 @@ static void ets_add_table(struct Ets *ets, struct EtsTable *ets_table)
87
87
synclist_unlock (& ets -> ets_tables );
88
88
}
89
89
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 )
91
91
{
92
92
uint64_t ref = 0 ;
93
93
term name = term_invalid_term ();
@@ -135,14 +135,14 @@ void ets_init(struct Ets *ets)
135
135
136
136
void ets_destroy (struct Ets * ets , GlobalContext * global )
137
137
{
138
- ets_delete_all_tables (ets , global );
138
+ delete_all_tables (ets , global );
139
139
synclist_destroy (& ets -> ets_tables );
140
140
}
141
141
142
142
EtsErrorCode ets_create_table_maybe_gc (term name , bool is_named , EtsTableType table_type , EtsAccessType access_type , size_t keypos , term * ret , Context * ctx )
143
143
{
144
144
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 );
146
146
if (ets_table != NULL ) {
147
147
return EtsTableNameInUse ;
148
148
}
@@ -209,7 +209,7 @@ static void ets_table_destroy(struct EtsTable *table, GlobalContext *global)
209
209
210
210
typedef bool (* ets_table_filter_pred )(struct EtsTable * table , void * data );
211
211
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 )
213
213
{
214
214
struct ListHead * ets_tables_list = synclist_wrlock (& ets -> ets_tables );
215
215
struct ListHead * item ;
@@ -232,7 +232,7 @@ static bool equal_process_id_pred(struct EtsTable *table, void *data)
232
232
233
233
void ets_delete_owned_tables (struct Ets * ets , int32_t process_id , GlobalContext * global )
234
234
{
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 );
236
236
}
237
237
238
238
static bool true_pred (struct EtsTable * table , void * data )
@@ -243,9 +243,9 @@ static bool true_pred(struct EtsTable *table, void *data)
243
243
return true;
244
244
}
245
245
246
- static void ets_delete_all_tables (struct Ets * ets , GlobalContext * global )
246
+ static void delete_all_tables (struct Ets * ets , GlobalContext * global )
247
247
{
248
- ets_delete_tables_internal (ets , true_pred , NULL , global );
248
+ delete_tables_pred (ets , true_pred , NULL , global );
249
249
}
250
250
251
251
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
351
351
352
352
EtsErrorCode ets_insert (term name_or_ref , term entry , Context * ctx )
353
353
{
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 );
355
355
if (IS_NULL_PTR (ets_table )) {
356
356
return EtsBadAccess ;
357
357
}
@@ -425,7 +425,7 @@ static EtsErrorCode lookup_maybe_gc(struct EtsTable *ets_table, term key, size_t
425
425
426
426
EtsErrorCode ets_lookup_maybe_gc (term name_or_ref , term key , term * ret , Context * ctx )
427
427
{
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 );
429
429
if (IS_NULL_PTR (ets_table )) {
430
430
return EtsBadAccess ;
431
431
}
@@ -438,7 +438,7 @@ EtsErrorCode ets_lookup_maybe_gc(term name_or_ref, term key, term *ret, Context
438
438
439
439
EtsErrorCode ets_lookup_element_maybe_gc (term name_or_ref , term key , size_t key_index , term * ret , Context * ctx )
440
440
{
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 );
442
442
if (IS_NULL_PTR (ets_table )) {
443
443
return EtsBadAccess ;
444
444
}
@@ -462,7 +462,7 @@ EtsErrorCode ets_lookup_element_maybe_gc(term name_or_ref, term key, size_t key_
462
462
463
463
EtsErrorCode ets_drop_table (term name_or_ref , term * ret , Context * ctx )
464
464
{
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 );
466
466
if (IS_NULL_PTR (ets_table )) {
467
467
return EtsBadAccess ;
468
468
}
@@ -480,7 +480,7 @@ EtsErrorCode ets_drop_table(term name_or_ref, term *ret, Context *ctx)
480
480
481
481
EtsErrorCode ets_delete (term name_or_ref , term key , term * ret , Context * ctx )
482
482
{
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 );
484
484
if (IS_NULL_PTR (ets_table )) {
485
485
return EtsBadAccess ;
486
486
}
@@ -540,7 +540,7 @@ static bool operation_to_tuple4(term operation, size_t default_pos, term *positi
540
540
541
541
EtsErrorCode ets_update_counter_maybe_gc (term ref , term key , term operation , term default_value , term * ret , Context * ctx )
542
542
{
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 );
544
544
if (IS_NULL_PTR (ets_table )) {
545
545
return EtsBadAccess ;
546
546
}
0 commit comments