Skip to content

Commit

Permalink
Remove set but unused variables
Browse files Browse the repository at this point in the history
Some compilers catch that these are unused:

 tcmalloc/testing/reclaim_test.cc:157:11: error: variable 'iter' set but not used [-Werror,-Wunused-but-set-variable]
   157 |       int iter = 0;
       |           ^
 1 error generated.

Remove them.

PiperOrigin-RevId: 641919386
Change-Id: I49753b1ec892a5db43445958013fb53ed7fb5f43
  • Loading branch information
melver authored and copybara-github committed Jun 10, 2024
1 parent 5cf2745 commit e73c0b2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions tcmalloc/testing/realized_fragmentation_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ TEST(RealizedFragmentation, Accuracy) {
void* small_list_keep = nullptr;
int kept = 0;
void* small_list_free = nullptr;
int freed = 0;

for (size_t total = 0; total < kSmallTarget; total += kSmallSize) {
void* object = ::operator new(kSmallSize);
Expand All @@ -166,7 +165,6 @@ TEST(RealizedFragmentation, Accuracy) {
kept++;
} else {
SLL_Push(&small_list_free, object);
freed++;
}
}

Expand Down
2 changes: 0 additions & 2 deletions tcmalloc/testing/reclaim_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ TEST(ReclaimTest, ReclaimStable) {
TC_CHECK(!tcmalloc_internal::subtle::percpu::IsFastNoInit());
}

int iter = 0;
while (!sync->load(std::memory_order_acquire)) {
iter++;
for (int i = 0, num_cpus = tcmalloc_internal::NumCPUs(); i < num_cpus;
++i) {
MallocExtension::ReleaseCpuMemory(i);
Expand Down

0 comments on commit e73c0b2

Please sign in to comment.