Skip to content

Commit

Permalink
remove test_only_reset_counters
Browse files Browse the repository at this point in the history
  • Loading branch information
ligurio committed Jul 10, 2024
1 parent af0152a commit 4325a73
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions luzer/counters.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,11 @@ int counter_index_registered = 0;
// Maximum number of counters and pctable entries that may be reserved and also
// the number that are allocated.
int max_counters = 0;
// Counter Allocations. These are allocated once, before __sanitize_... are
// called and can only be deallocated by test_only_reset_counters.
// Counter Allocations. These are allocated once,
// before __sanitize_... are called.
unsigned char* counters = NULL;
struct PCTableEntry* pctable = NULL;

NO_SANITIZE void
test_only_reset_counters(void) {
if (counters) {
munmap(counters, max_counters);
counters = NULL;
}
if (pctable) {
munmap(pctable, max_counters);
pctable = NULL;
}
max_counters = 0;
counter_index = 0;
counter_index_registered = 0;
}

NO_SANITIZE int
reserve_counters(int counters) {
int ret = counter_index;
Expand Down

0 comments on commit 4325a73

Please sign in to comment.