From c43de55677d79f34689292cbe16779cc02aee50d Mon Sep 17 00:00:00 2001 From: Alexander Shabalin Date: Fri, 24 Jul 2020 11:15:36 +0300 Subject: [PATCH] Fix setColorUnlessGreen (#4300) Previously this method effectively did nothing. Luckily, it was only used to reset color during freezing, which is fine: frozen objects do not use color. --- runtime/src/main/cpp/Memory.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/src/main/cpp/Memory.h b/runtime/src/main/cpp/Memory.h index 6e651448346..e973433d8d8 100644 --- a/runtime/src/main/cpp/Memory.h +++ b/runtime/src/main/cpp/Memory.h @@ -236,9 +236,9 @@ struct ContainerHeader { inline void setColorUnlessGreen(unsigned color) { // TODO: do we need atomic color update? - unsigned objectCount_ = objectCount_; - if ((objectCount_ & CONTAINER_TAG_GC_COLOR_MASK) != CONTAINER_TAG_GC_GREEN) - objectCount_ = (objectCount_ & ~CONTAINER_TAG_GC_COLOR_MASK) | color; + unsigned objectCount = objectCount_; + if ((objectCount & CONTAINER_TAG_GC_COLOR_MASK) != CONTAINER_TAG_GC_GREEN) + objectCount_ = (objectCount & ~CONTAINER_TAG_GC_COLOR_MASK) | color; } inline bool buffered() const {