Commit af0b2207 authored by antirez's avatar antirez
Browse files

zmalloc: kill unused __size parameter in update_zmalloc_stat_alloc() macro.

parent a779b7e9
...@@ -85,7 +85,7 @@ void zlibc_free(void *ptr) { ...@@ -85,7 +85,7 @@ void zlibc_free(void *ptr) {
#endif #endif
#define update_zmalloc_stat_alloc(__n,__size) do { \ #define update_zmalloc_stat_alloc(__n) do { \
size_t _n = (__n); \ size_t _n = (__n); \
if (_n&(sizeof(long)-1)) _n += sizeof(long)-(_n&(sizeof(long)-1)); \ if (_n&(sizeof(long)-1)) _n += sizeof(long)-(_n&(sizeof(long)-1)); \
if (zmalloc_thread_safe) { \ if (zmalloc_thread_safe) { \
...@@ -123,11 +123,11 @@ void *zmalloc(size_t size) { ...@@ -123,11 +123,11 @@ void *zmalloc(size_t size) {
if (!ptr) zmalloc_oom_handler(size); if (!ptr) zmalloc_oom_handler(size);
#ifdef HAVE_MALLOC_SIZE #ifdef HAVE_MALLOC_SIZE
update_zmalloc_stat_alloc(zmalloc_size(ptr),size); update_zmalloc_stat_alloc(zmalloc_size(ptr));
return ptr; return ptr;
#else #else
*((size_t*)ptr) = size; *((size_t*)ptr) = size;
update_zmalloc_stat_alloc(size+PREFIX_SIZE,size); update_zmalloc_stat_alloc(size+PREFIX_SIZE);
return (char*)ptr+PREFIX_SIZE; return (char*)ptr+PREFIX_SIZE;
#endif #endif
} }
...@@ -137,11 +137,11 @@ void *zcalloc(size_t size) { ...@@ -137,11 +137,11 @@ void *zcalloc(size_t size) {
if (!ptr) zmalloc_oom_handler(size); if (!ptr) zmalloc_oom_handler(size);
#ifdef HAVE_MALLOC_SIZE #ifdef HAVE_MALLOC_SIZE
update_zmalloc_stat_alloc(zmalloc_size(ptr),size); update_zmalloc_stat_alloc(zmalloc_size(ptr));
return ptr; return ptr;
#else #else
*((size_t*)ptr) = size; *((size_t*)ptr) = size;
update_zmalloc_stat_alloc(size+PREFIX_SIZE,size); update_zmalloc_stat_alloc(size+PREFIX_SIZE);
return (char*)ptr+PREFIX_SIZE; return (char*)ptr+PREFIX_SIZE;
#endif #endif
} }
...@@ -160,7 +160,7 @@ void *zrealloc(void *ptr, size_t size) { ...@@ -160,7 +160,7 @@ void *zrealloc(void *ptr, size_t size) {
if (!newptr) zmalloc_oom_handler(size); if (!newptr) zmalloc_oom_handler(size);
update_zmalloc_stat_free(oldsize); update_zmalloc_stat_free(oldsize);
update_zmalloc_stat_alloc(zmalloc_size(newptr),size); update_zmalloc_stat_alloc(zmalloc_size(newptr));
return newptr; return newptr;
#else #else
realptr = (char*)ptr-PREFIX_SIZE; realptr = (char*)ptr-PREFIX_SIZE;
...@@ -170,7 +170,7 @@ void *zrealloc(void *ptr, size_t size) { ...@@ -170,7 +170,7 @@ void *zrealloc(void *ptr, size_t size) {
*((size_t*)newptr) = size; *((size_t*)newptr) = size;
update_zmalloc_stat_free(oldsize); update_zmalloc_stat_free(oldsize);
update_zmalloc_stat_alloc(size,size); update_zmalloc_stat_alloc(size);
return (char*)newptr+PREFIX_SIZE; return (char*)newptr+PREFIX_SIZE;
#endif #endif
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment