r3399 - trunk/varnish-cache/lib/libjemalloc

petter at projects.linpro.no petter at projects.linpro.no
Mon Nov 17 14:31:37 CET 2008


Author: petter
Date: 2008-11-17 14:31:37 +0100 (Mon, 17 Nov 2008)
New Revision: 3399

Modified:
   trunk/varnish-cache/lib/libjemalloc/jemalloc_linux.c
Log:
Fixed compiling on Linux with -Werror set. Added mising prototypes, removed an unused function and added the ATTRIBUTE_UNUSED to the attribute list for the rb_wrap() macro which generated unused functions.


Modified: trunk/varnish-cache/lib/libjemalloc/jemalloc_linux.c
===================================================================
--- trunk/varnish-cache/lib/libjemalloc/jemalloc_linux.c	2008-11-14 13:04:10 UTC (rev 3398)
+++ trunk/varnish-cache/lib/libjemalloc/jemalloc_linux.c	2008-11-17 13:31:37 UTC (rev 3399)
@@ -197,6 +197,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <pthread.h>
+#include <ansidecl.h>
 
 #include "rb.h"
 
@@ -1113,7 +1114,6 @@
 static bool	base_pages_alloc_mmap(size_t minsize);
 static bool	base_pages_alloc(size_t minsize);
 static void	*base_alloc(size_t size);
-static void	*base_calloc(size_t number, size_t size);
 static extent_node_t *base_node_alloc(void);
 static void	base_node_dealloc(extent_node_t *node);
 #ifdef MALLOC_STATS
@@ -1200,6 +1200,14 @@
  */
 /******************************************************************************/
 
+/*
+ * Functions missing prototypes which caused -Werror to fail. 
+ * Not sure if it has any side effects.
+ * */
+size_t malloc_usable_size(const void *ptr);
+void _malloc_thread_cleanup(void);
+
+
 static void
 wrtmessage(const char *p1, const char *p2, const char *p3, const char *p4)
 {
@@ -1625,17 +1633,6 @@
 	return (ret);
 }
 
-static void *
-base_calloc(size_t number, size_t size)
-{
-	void *ret;
-
-	ret = base_alloc(number * size);
-	memset(ret, 0, number * size);
-
-	return (ret);
-}
-
 static extent_node_t *
 base_node_alloc(void)
 {
@@ -1779,7 +1776,7 @@
 }
 
 /* Wrap red-black tree macros in functions. */
-rb_wrap(static, extent_tree_szad_, extent_tree_t, extent_node_t,
+rb_wrap(static ATTRIBUTE_UNUSED, extent_tree_szad_, extent_tree_t, extent_node_t,
     link_szad, extent_szad_comp)
 #endif
 
@@ -1793,7 +1790,7 @@
 }
 
 /* Wrap red-black tree macros in functions. */
-rb_wrap(static, extent_tree_ad_, extent_tree_t, extent_node_t, link_ad,
+rb_wrap(static ATTRIBUTE_UNUSED, extent_tree_ad_, extent_tree_t, extent_node_t, link_ad,
     extent_ad_comp)
 
 /*
@@ -2347,7 +2344,7 @@
 }
 
 /* Wrap red-black tree macros in functions. */
-rb_wrap(static, arena_chunk_tree_dirty_, arena_chunk_tree_t,
+rb_wrap(static ATTRIBUTE_UNUSED, arena_chunk_tree_dirty_, arena_chunk_tree_t,
     arena_chunk_t, link_dirty, arena_chunk_comp)
 
 static inline int
@@ -2363,7 +2360,7 @@
 }
 
 /* Wrap red-black tree macros in functions. */
-rb_wrap(static, arena_run_tree_, arena_run_tree_t, arena_chunk_map_t,
+rb_wrap(static ATTRIBUTE_UNUSED, arena_run_tree_, arena_run_tree_t, arena_chunk_map_t,
     link, arena_run_comp)
 
 static inline int
@@ -2395,7 +2392,7 @@
 }
 
 /* Wrap red-black tree macros in functions. */
-rb_wrap(static, arena_avail_tree_, arena_avail_tree_t,
+rb_wrap(static ATTRIBUTE_UNUSED, arena_avail_tree_, arena_avail_tree_t,
     arena_chunk_map_t, link, arena_avail_comp)
 
 static inline void *



More information about the varnish-commit mailing list