summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2012-11-14 12:52:38 +0100
committerantirez <antirez@gmail.com>2012-11-14 13:07:48 +0100
commit681c1910064356b330e92f31374058788059e53c (patch)
treec3669b88cc94d0387fc1892023753ac59f24e005
parentd85a09dfc6a55089483fb67ccc454f0bc0b1b0f6 (diff)
downloadredis-681c1910064356b330e92f31374058788059e53c.tar.gz
zmalloc: kill unused __size parameter in update_zmalloc_stat_alloc() macro.
-rw-r--r--src/zmalloc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/zmalloc.c b/src/zmalloc.c
index 43d60a9c6..1ebf68d17 100644
--- a/src/zmalloc.c
+++ b/src/zmalloc.c
@@ -85,7 +85,7 @@ void zlibc_free(void *ptr) {
#endif
-#define update_zmalloc_stat_alloc(__n,__size) do { \
+#define update_zmalloc_stat_alloc(__n) do { \
size_t _n = (__n); \
if (_n&(sizeof(long)-1)) _n += sizeof(long)-(_n&(sizeof(long)-1)); \
if (zmalloc_thread_safe) { \
@@ -123,11 +123,11 @@ void *zmalloc(size_t size) {
if (!ptr) zmalloc_oom_handler(size);
#ifdef HAVE_MALLOC_SIZE
- update_zmalloc_stat_alloc(zmalloc_size(ptr),size);
+ update_zmalloc_stat_alloc(zmalloc_size(ptr));
return ptr;
#else
*((size_t*)ptr) = size;
- update_zmalloc_stat_alloc(size+PREFIX_SIZE,size);
+ update_zmalloc_stat_alloc(size+PREFIX_SIZE);
return (char*)ptr+PREFIX_SIZE;
#endif
}
@@ -137,11 +137,11 @@ void *zcalloc(size_t size) {
if (!ptr) zmalloc_oom_handler(size);
#ifdef HAVE_MALLOC_SIZE
- update_zmalloc_stat_alloc(zmalloc_size(ptr),size);
+ update_zmalloc_stat_alloc(zmalloc_size(ptr));
return ptr;
#else
*((size_t*)ptr) = size;
- update_zmalloc_stat_alloc(size+PREFIX_SIZE,size);
+ update_zmalloc_stat_alloc(size+PREFIX_SIZE);
return (char*)ptr+PREFIX_SIZE;
#endif
}
@@ -160,7 +160,7 @@ void *zrealloc(void *ptr, size_t size) {
if (!newptr) zmalloc_oom_handler(size);
update_zmalloc_stat_free(oldsize);
- update_zmalloc_stat_alloc(zmalloc_size(newptr),size);
+ update_zmalloc_stat_alloc(zmalloc_size(newptr));
return newptr;
#else
realptr = (char*)ptr-PREFIX_SIZE;
@@ -170,7 +170,7 @@ void *zrealloc(void *ptr, size_t size) {
*((size_t*)newptr) = size;
update_zmalloc_stat_free(oldsize);
- update_zmalloc_stat_alloc(size,size);
+ update_zmalloc_stat_alloc(size);
return (char*)newptr+PREFIX_SIZE;
#endif
}