diff options
author | antirez <antirez@gmail.com> | 2017-05-04 17:00:53 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2017-05-04 17:01:00 +0200 |
commit | 2a51bac44ebcff79dcd8ede2cab66ca213c9d504 (patch) | |
tree | 69267037fab3844dab3f77f17df9100acaeee1f5 /src/zmalloc.c | |
parent | 52bc74f22150183111bc0da9cd2c29de440a50b5 (diff) | |
download | redis-2a51bac44ebcff79dcd8ede2cab66ca213c9d504.tar.gz |
Simplify atomicvar.h usage by having the mutex name implicit.
Diffstat (limited to 'src/zmalloc.c')
-rw-r--r-- | src/zmalloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/zmalloc.c b/src/zmalloc.c index f653760a7..dfcfc01d4 100644 --- a/src/zmalloc.c +++ b/src/zmalloc.c @@ -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; } |