#define update_zmalloc_stat_alloc(__n) do { \
size_t _n = (__n); \
if (_n&(sizeof(long)-1)) _n += sizeof(long)-(_n&(sizeof(long)-1)); \
atomicIncr(used_memory,__n); \
} while(0)
It will be expanded as do { size_t _n = (malloc_size(ptr)); if (_n&(sizeof(long)-1)) _n += sizeof(long)-(_n&(sizeof(long)-1)); atomicIncr(&used_memory,malloc_size(ptr)); } while(0);
Should it be atomicIncr(used_memory,_n)?
Comment From: BotaoDu
I have the same doubts
Comment From: yeefea
The redundant code is removed in this commit. This issue can be closed. @antirez
Comment From: oranagra
thanks @Blueswing, i think using _n would be a bug. instead, it was just some dead code.