Skip to content

Commit

Permalink
Merge pull request #38 from project-tsurugi/fix_loop_in_gc
Browse files Browse the repository at this point in the history
remove unnecessary loop in gc
  • Loading branch information
ban-nobuhiro authored May 21, 2024
2 parents 2cad3b1 + ba87f89 commit db52cbb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/garbage_collection.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class garbage_collection {

while (!node_container_.empty()) {
std::tuple<Epoch, base_node*> elem;
while (!node_container_.try_pop(elem)) continue;
if (!node_container_.try_pop(elem)) { continue; }
delete std::get<gc_target_index>(elem); // NOLINT
}

Expand All @@ -48,7 +48,7 @@ class garbage_collection {

while (!value_container_.empty()) {
std::tuple<Epoch, void*, std::size_t, std::align_val_t> elem;
while (!value_container_.try_pop(elem)) continue;
if (!value_container_.try_pop(elem)) { continue; }
::operator delete(std::get<gc_target_index>(elem),
std::get<gc_target_size_index>(elem),
std::get<gc_target_align_index>(elem));
Expand Down Expand Up @@ -87,7 +87,7 @@ class garbage_collection {
// for container
while (!node_container_.empty()) {
std::tuple<Epoch, base_node*> elem;
while (!node_container_.try_pop(elem)) continue;
if (!node_container_.try_pop(elem)) { continue; }
if (std::get<gc_epoch_index>(elem) >= gc_epoch) {
cache_node_container_ = elem;
return;
Expand Down Expand Up @@ -156,4 +156,4 @@ class garbage_collection {
value_container_; // NOLINT
};

} // namespace yakushima
} // namespace yakushima

0 comments on commit db52cbb

Please sign in to comment.