Skip to content

Commit f05c37e

Browse files
committed
Use size_t for atom_table_count
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
1 parent ee8fdf9 commit f05c37e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/libAtomVM/atom_table.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ struct HNodeGroup
6464

6565
struct AtomTable
6666
{
67-
int capacity;
68-
int count;
67+
size_t capacity;
68+
size_t count;
6969
int last_node_group_avail;
7070
#ifndef AVM_NO_SMP
7171
RWLock *lock;
@@ -118,10 +118,10 @@ void atom_table_destroy(struct AtomTable *table)
118118
free(table);
119119
}
120120

121-
int atom_table_count(struct AtomTable *table)
121+
size_t atom_table_count(struct AtomTable *table)
122122
{
123123
SMP_RDLOCK(table);
124-
int count = table->count;
124+
size_t count = table->count;
125125
SMP_UNLOCK(table);
126126

127127
return count;

src/libAtomVM/atom_table.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ typedef const void *atom_ref_t;
5353
struct AtomTable *atom_table_new();
5454
void atom_table_destroy(struct AtomTable *table);
5555

56-
int atom_table_count(struct AtomTable *table);
56+
size_t atom_table_count(struct AtomTable *table);
5757

5858
long atom_table_ensure_atom(struct AtomTable *table, AtomString string, enum AtomTableCopyOpt opts);
5959

src/libAtomVM/opcodesswitch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ COLD_FUNC static void dump(Context *ctx)
14721472

14731473
fprintf(stderr, "process_count = %zu\n", process_count);
14741474
fprintf(stderr, "ports_count = %zu\n", ports_count);
1475-
fprintf(stderr, "atoms_count = %d\n", atom_table_count(glb->atom_table));
1475+
fprintf(stderr, "atoms_count = %zu\n", atom_table_count(glb->atom_table));
14761476
fprintf(stderr, "refc_binary_total_size = %zu\n", refc_binary_total_size(ctx));
14771477
}
14781478
fprintf(stderr, "\n\n**End Of Crash Report**\n");

0 commit comments

Comments
 (0)