forked from OSchip/llvm-project
parent
a65db1e9ee
commit
f88f317d35
|
@ -133,7 +133,7 @@ void AddrHashMap<T, kSize>::acquire(Handle *h) {
|
||||||
Bucket *b = &table_[hash];
|
Bucket *b = &table_[hash];
|
||||||
|
|
||||||
h->created_ = false;
|
h->created_ = false;
|
||||||
h->addidx_ = -1;
|
h->addidx_ = -1U;
|
||||||
h->bucket_ = b;
|
h->bucket_ = b;
|
||||||
h->cell_ = 0;
|
h->cell_ = 0;
|
||||||
|
|
||||||
|
@ -272,7 +272,7 @@ void AddrHashMap<T, kSize>::release(Handle *h) {
|
||||||
atomic_store(&c->addr, 0, memory_order_release);
|
atomic_store(&c->addr, 0, memory_order_release);
|
||||||
// See if we need to compact the bucket.
|
// See if we need to compact the bucket.
|
||||||
AddBucket *add = (AddBucket*)atomic_load(&b->add, memory_order_relaxed);
|
AddBucket *add = (AddBucket*)atomic_load(&b->add, memory_order_relaxed);
|
||||||
if (h->addidx_ == -1) {
|
if (h->addidx_ == -1U) {
|
||||||
// Removed from embed array, move an add element into the freed cell.
|
// Removed from embed array, move an add element into the freed cell.
|
||||||
if (add) {
|
if (add) {
|
||||||
uptr last = --add->size;
|
uptr last = --add->size;
|
||||||
|
@ -293,7 +293,7 @@ void AddrHashMap<T, kSize>::release(Handle *h) {
|
||||||
b->mtx.Unlock();
|
b->mtx.Unlock();
|
||||||
} else {
|
} else {
|
||||||
CHECK_EQ(addr1, h->addr_);
|
CHECK_EQ(addr1, h->addr_);
|
||||||
if (h->addidx_ != -1)
|
if (h->addidx_ != -1U)
|
||||||
b->mtx.ReadUnlock();
|
b->mtx.ReadUnlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue