[PATCH] Fix malloc_usable_size definition
mh+jemalloc at glandium.org
mh+jemalloc at glandium.org
Tue Oct 9 02:21:14 PDT 2012
From: Mike Hommey <mh at glandium.org>
The function declaration in system headers uses void * instead of const void *, and
that can lead to conflicts when building against recent Android NDKs, where string.h
includes malloc.h, which contains that conflicting definition.
---
include/jemalloc/jemalloc.h.in | 2 +-
src/jemalloc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/jemalloc/jemalloc.h.in b/include/jemalloc/jemalloc.h.in
index ad06948..f210a0b 100644
--- a/include/jemalloc/jemalloc.h.in
+++ b/include/jemalloc/jemalloc.h.in
@@ -59,7 +59,7 @@ JEMALLOC_EXPORT void * je_memalign(size_t alignment, size_t size)
JEMALLOC_EXPORT void * je_valloc(size_t size) JEMALLOC_ATTR(malloc);
#endif
-JEMALLOC_EXPORT size_t je_malloc_usable_size(const void *ptr);
+JEMALLOC_EXPORT size_t je_malloc_usable_size(void *ptr);
JEMALLOC_EXPORT void je_malloc_stats_print(void (*write_cb)(void *,
const char *), void *je_cbopaque, const char *opts);
JEMALLOC_EXPORT int je_mallctl(const char *name, void *oldp,
diff --git a/src/jemalloc.c b/src/jemalloc.c
index bc54cd7..9125236 100644
--- a/src/jemalloc.c
+++ b/src/jemalloc.c
@@ -1279,7 +1279,7 @@ JEMALLOC_EXPORT void *(* const __memalign_hook)(size_t alignment, size_t size) =
*/
size_t
-je_malloc_usable_size(const void *ptr)
+je_malloc_usable_size(void *ptr)
{
size_t ret;
--
1.7.10.4
More information about the jemalloc-discuss
mailing list