summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2012-04-04 15:45:12 +0300
committerAlon Levy <alevy@redhat.com>2012-04-24 12:16:31 +0300
commita4773c508735ec3e9779c46e966a07d388e265dc (patch)
treeeaaf1b2f255ae37d218df6932e788ec00390332d
parent01f77c0c42e2b9058e48a9ac4ae171609119ce12 (diff)
mspace: no more warnings
-rw-r--r--src/mspace.c11
-rw-r--r--src/mspace.h5
2 files changed, 10 insertions, 6 deletions
diff --git a/src/mspace.c b/src/mspace.c
index 94d50e6..17d976a 100644
--- a/src/mspace.c
+++ b/src/mspace.c
@@ -21,8 +21,6 @@
#include <string.h>
#include "mspace.h"
-#pragma warning( disable : 4146 ) /* no "unsigned" warnings */
-
#define MALLOC_ALIGNMENT ((size_t)8U)
#define USE_LOCKS 0
#define malloc_getpagesize ((size_t)4096U)
@@ -47,12 +45,12 @@
#define M_GRANULARITY (-1)
-void default_abort_func(void *user_data)
+void __attribute__ ((__noreturn__)) default_abort_func(void *user_data)
{
for (;;);
}
-void default_print_func(void *user_data, char *format, ...)
+void default_print_func(void *user_data, const char *format, ...)
{
}
@@ -762,6 +760,7 @@ static struct malloc_params mparams;
#define segment_holds(S, A)\
((char*)(A) >= S->base && (char*)(A) < S->base + S->size)
+#if DEBUG
/* Return segment holding given address */
static msegmentptr segment_holding(mstate m, char* addr) {
msegmentptr sp = &m->seg;
@@ -783,7 +782,7 @@ static int has_segment_link(mstate m, msegmentptr ss) {
return 0;
}
}
-
+#endif
/*
@@ -1795,6 +1794,7 @@ static void reset_on_error(mstate m) {
}
#endif /* PROCEED_ON_ERROR */
+#if 0
/* Allocate chunk and prepend remainder with chunk in successor base. */
static void* prepend_alloc(mstate m, char* newbase, char* oldbase,
size_t nb) {
@@ -1836,6 +1836,7 @@ static void* prepend_alloc(mstate m, char* newbase, char* oldbase,
check_malloced_chunk(m, chunk2mem(p), nb);
return chunk2mem(p);
}
+#endif
/* -------------------------- System allocation -------------------------- */
diff --git a/src/mspace.h b/src/mspace.h
index 96b0593..8f5ba83 100644
--- a/src/mspace.h
+++ b/src/mspace.h
@@ -9,11 +9,14 @@ extern "C" {
//typedef unsigned long size_t;
typedef void (*mspace_abort_t)(void *user_data);
-typedef void (*mspace_print_t)(void *user_data, char *format, ...);
+typedef void (*mspace_print_t)(void *user_data, const char *format, ...);
void mspace_set_abort_func(mspace_abort_t f);
void mspace_set_print_func(mspace_print_t f);
+void default_abort_func(void *user_data);
+void default_print_func(void *user_data, const char *format, ...);
+
/*
mspace is an opaque type representing an independent
region of space that supports mspace_malloc, etc.