Decrements reference count and deletes this object if count reaches 0.
| 114 | |
| 115 | // Decrements reference count and deletes this object if count reaches 0. |
| 116 | void Regexp::Decref() { |
| 117 | if (ref_ == kMaxRef) { |
| 118 | // Ref count is stored in overflow map. |
| 119 | MutexLock l(ref_mutex); |
| 120 | int r = (*ref_map)[this] - 1; |
| 121 | if (r < kMaxRef) { |
| 122 | ref_ = static_cast<uint16_t>(r); |
| 123 | ref_map->erase(this); |
| 124 | } else { |
| 125 | (*ref_map)[this] = r; |
| 126 | } |
| 127 | return; |
| 128 | } |
| 129 | ref_--; |
| 130 | if (ref_ == 0) |
| 131 | Destroy(); |
| 132 | } |
| 133 | |
| 134 | // Deletes this object; ref count has count reached 0. |
| 135 | void Regexp::Destroy() { |
no test coverage detected