mirror of
https://github.com/fluencelabs/redis
synced 2025-06-22 13:31:32 +00:00
Simplify atomicvar.h usage by having the mutex name implicit.
This commit is contained in:
@ -74,7 +74,7 @@ void zlibc_free(void *ptr) {
|
||||
size_t _n = (__n); \
|
||||
if (_n&(sizeof(long)-1)) _n += sizeof(long)-(_n&(sizeof(long)-1)); \
|
||||
if (zmalloc_thread_safe) { \
|
||||
atomicIncr(used_memory,__n,used_memory_mutex); \
|
||||
atomicIncr(used_memory,__n); \
|
||||
} else { \
|
||||
used_memory += _n; \
|
||||
} \
|
||||
@ -84,7 +84,7 @@ void zlibc_free(void *ptr) {
|
||||
size_t _n = (__n); \
|
||||
if (_n&(sizeof(long)-1)) _n += sizeof(long)-(_n&(sizeof(long)-1)); \
|
||||
if (zmalloc_thread_safe) { \
|
||||
atomicDecr(used_memory,__n,used_memory_mutex); \
|
||||
atomicDecr(used_memory,__n); \
|
||||
} else { \
|
||||
used_memory -= _n; \
|
||||
} \
|
||||
@ -222,7 +222,7 @@ size_t zmalloc_used_memory(void) {
|
||||
size_t um;
|
||||
|
||||
if (zmalloc_thread_safe) {
|
||||
atomicGet(used_memory,um,used_memory_mutex);
|
||||
atomicGet(used_memory,um);
|
||||
} else {
|
||||
um = used_memory;
|
||||
}
|
||||
|
Reference in New Issue
Block a user