From 25a87f7641f066437d15c6d3148d08a6ab9be231 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Thu, 23 May 2013 10:02:02 +0200 Subject: [PATCH] Fix declaration of malloc_usable_size() The function should take a 'const void*' parameter, instead of 'void*'. Note that the implementation in upstream-dlmalloc/malloc.c already does this. For context, see http://b.android.com/55725 Change-Id: Iefd55cdb8996699189e0545f9195972490306227 --- libc/bionic/malloc_debug_common.cpp | 2 +- libc/include/malloc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libc/bionic/malloc_debug_common.cpp b/libc/bionic/malloc_debug_common.cpp index f6fa83c15..9cc84c34f 100644 --- a/libc/bionic/malloc_debug_common.cpp +++ b/libc/bionic/malloc_debug_common.cpp @@ -190,7 +190,7 @@ extern "C" struct mallinfo mallinfo() { return dlmallinfo(); } -extern "C" size_t malloc_usable_size(void* mem) { +extern "C" size_t malloc_usable_size(const void* mem) { return dlmalloc_usable_size(mem); } diff --git a/libc/include/malloc.h b/libc/include/malloc.h index 8875e542d..eaedc4925 100644 --- a/libc/include/malloc.h +++ b/libc/include/malloc.h @@ -33,7 +33,7 @@ extern void* realloc(void* p, size_t byte_count) __wur; extern void free(void* p); extern void* memalign(size_t alignment, size_t byte_count) __mallocfunc __wur; -extern size_t malloc_usable_size(void* p); +extern size_t malloc_usable_size(const void* p); extern void* valloc(size_t byte_count) __mallocfunc __wur; extern void* pvalloc(size_t byte_count) __mallocfunc __wur;