Mark a merge node as live REQUIRES: Node corresponding to "h" is a merge node
| 196 | // Mark a merge node as live |
| 197 | // REQUIRES: Node corresponding to "h" is a merge node |
| 198 | void mark_live(Handle h) { |
| 199 | if (h.is_large_) { |
| 200 | std::atomic<LargeCounts>* c_ptr = Large(h); |
| 201 | auto c = c_ptr->load(std::memory_order_relaxed); |
| 202 | // Only do anything if the node hasn't already started executing. |
| 203 | if (PENDING_NOTREADY == NodeStateForStruct(c)) { |
| 204 | c.pending &= ~static_cast<int>(0x1); |
| 205 | c_ptr->store(c, std::memory_order_relaxed); |
| 206 | } |
| 207 | } else { |
| 208 | std::atomic<PackedCounts>* c_ptr = Packed(h); |
| 209 | auto c = c_ptr->load(std::memory_order_relaxed); |
| 210 | // Only do anything if the node hasn't already started executing. |
| 211 | if (PENDING_NOTREADY == NodeStateForStruct(c)) { |
| 212 | static_assert(7 == kMaxCountForPackedCounts, |
| 213 | "Live flag incorrect for max packed count"); |
| 214 | c.pending &= 0x6; |
| 215 | c_ptr->store(c, std::memory_order_relaxed); |
| 216 | } |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | int dead_count(Handle h) { |
| 221 | int r = h.is_large_ ? Large(h)->load(std::memory_order_relaxed).dead_count |