Skip to content

Commit

Permalink
Merge pull request #480 from markpmitchell/ds-cleanup
Browse files Browse the repository at this point in the history
Centralize extendable array logic
  • Loading branch information
disteph authored Dec 1, 2023
2 parents 29357c1 + 8a46390 commit 6bf219c
Show file tree
Hide file tree
Showing 23 changed files with 1,043 additions and 1,025 deletions.
1 change: 1 addition & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ core_src_c := \
utils/generic_heap.c \
utils/hash_functions.c \
utils/index_vectors.c \
utils/indexed_table.c \
utils/int_array_hsets.c \
utils/int_array_sort2.c \
utils/int_array_sort.c \
Expand Down
8 changes: 4 additions & 4 deletions src/api/yices_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2637,11 +2637,11 @@ static bool check_all_distinct(term_table_t *terms, uint32_t n, const term_t *va
result = true;
if (n > 1) {

if (n > terms->live_terms) {
if (n > live_terms(terms)) {
/*
* there must be duplicates
* we check this first just to be safe
* since n <= terms->live_terms <= YICES_MAX_TERMS,
* since n <= live_terms <= YICES_MAX_TERMS,
* we know that n * sizeof(term_t) fits in 32bits
* (which matters when we call safe_malloc(n * sizeof(term_t)).
*/
Expand Down Expand Up @@ -12342,15 +12342,15 @@ EXPORTED uint32_t yices_num_terms(void) {
}

uint32_t _o_yices_num_terms(void) {
return __yices_globals.terms->live_terms;
return live_terms(__yices_globals.terms);
}

EXPORTED uint32_t yices_num_types(void) {
MT_PROTECT(uint32_t, __yices_globals.lock, _o_yices_num_types());
}

uint32_t _o_yices_num_types(void) {
return __yices_globals.types->live_types;
return live_types(__yices_globals.types);
}


Expand Down
2 changes: 1 addition & 1 deletion src/include/yices_limits.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <stdint.h>

/*
* Maximal number of types or terms
* Maximal number of types or terms.
*/
#define YICES_MAX_TYPES (UINT32_MAX/8)
#define YICES_MAX_TERMS (UINT32_MAX/8)
Expand Down
Loading

0 comments on commit 6bf219c

Please sign in to comment.