From fb5377fb79eac65c5cf2241e3d59dac93bfcca68 Mon Sep 17 00:00:00 2001 From: petter Date: Mon, 17 Nov 2008 13:31:37 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3399 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- .../lib/libjemalloc/jemalloc_linux.c | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/varnish-cache/lib/libjemalloc/jemalloc_linux.c b/varnish-cache/lib/libjemalloc/jemalloc_linux.c index a44297a2..a0b15bb9 100644 --- a/varnish-cache/lib/libjemalloc/jemalloc_linux.c +++ b/varnish-cache/lib/libjemalloc/jemalloc_linux.c @@ -197,6 +197,7 @@ #include #include #include +#include #include "rb.h" @@ -1113,7 +1114,6 @@ static bool base_pages_alloc_dss(size_t minsize); 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 @@ void _malloc_postfork(void); */ /******************************************************************************/ +/* + * 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 @@ base_alloc(size_t size) 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 @@ extent_szad_comp(extent_node_t *a, extent_node_t *b) } /* 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 @@ extent_ad_comp(extent_node_t *a, extent_node_t *b) } /* 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 @@ arena_chunk_comp(arena_chunk_t *a, arena_chunk_t *b) } /* 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 @@ arena_run_comp(arena_chunk_map_t *a, arena_chunk_map_t *b) } /* 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 @@ arena_avail_comp(arena_chunk_map_t *a, arena_chunk_map_t *b) } /* 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 * -- 2.39.5