#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)

What does an "if" branch do if atomicIncr use __n

Comment From: onriv

yeah i think its strange too. Maybe atomicincr should use _n

Comment From: oranagra

seems like it's dead code that should have been removed by 6eb51bf1ec

Comment From: kycheng

@oranagra What was the original intent of this code?

Why doesn't this code be required in thread-safe mode?

Comment From: oranagra

it seems that it intended to do is to align the size upwards to round size of long. it was probably needed before we started using malloc_size. i.e if redis was allocating 7 bytes, it would count 8. but now that we use malloc_size, we know how much it really consumes (including internal-fragmentation).