diff options
author | Eric Wong <e@80x24.org> | 2022-12-15 20:52:43 +0000 |
---|---|---|
committer | Eric Wong <mwrap-perl@80x24.org> | 2022-12-16 09:27:41 +0000 |
commit | 4dbf07af51e2b560c379324a7551dd247bb52de4 (patch) | |
tree | 242860322fe6f46c29e8d46fb71708623d6ecdfc | |
parent | 2a8ca1bb5085e16a8c23ee50e4182c855e757f88 (diff) | |
download | mwrap-4dbf07af51e2b560c379324a7551dd247bb52de4.tar.gz |
It's slightly more readable IMHO, and perhaps it generates better code on x86 (since URCU has x86-specific paths for it).
-rw-r--r-- | mwrap_core.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mwrap_core.h b/mwrap_core.h index 4dc28d4..d798b79 100644 --- a/mwrap_core.h +++ b/mwrap_core.h @@ -280,7 +280,7 @@ again: l = src_loc_get(t, k); if (l) { uatomic_add(&l->total, k->total); - uatomic_add(&l->allocations, 1); + uatomic_inc(&l->allocations); } else { size_t n = bt_bytelen(k) + sizeof(*k); struct cds_lfht_node *cur; @@ -462,7 +462,7 @@ void free(void *p) uatomic_add(&total_bytes_dec, h->size); uatomic_add(&l->freed_bytes, h->size); uatomic_set(&h->size, 0); - uatomic_add(&l->frees, 1); + uatomic_inc(&l->frees); uatomic_add(&l->age_total, age); CHECK(int, 0, pthread_mutex_lock(l->mtx)); |