Skip to content

Commit

Permalink
Fix non-critical bug in small_free_memory_list::find_chunk()
Browse files Browse the repository at this point in the history
It didn't actually search into both directions as advertised.
This has no significant impact on the profiling results but should be fixed anyways.
  • Loading branch information
foonathan committed Apr 12, 2016
1 parent 6c09f59 commit dff0474
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/detail/small_free_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,10 @@ chunk* small_free_memory_list::find_chunk_impl(std::size_t n) FOONATHAN_NOEXCEPT
return c;

cur_forward = cur_forward->next;
cur_backward = cur_backward->next;
} while (cur_forward != cur_backward);
cur_backward = cur_backward->prev;
FOONATHAN_MEMORY_ASSERT(cur_forward != alloc_chunk_);
FOONATHAN_MEMORY_ASSERT(cur_backward != alloc_chunk_);
} while (true);
FOONATHAN_MEMORY_UNREACHABLE("there is memory available somewhere...");
return nullptr;
}
Expand Down

0 comments on commit dff0474

Please sign in to comment.