Commit 60ce32c4 authored by Yuki Shiino's avatar Yuki Shiino Committed by Commit Bot

base/allocator: Fix the argument type of malloc_size

malloc_size is provided only on macOS/iOS (the counterpart on
GNU/Linux is malloc_usable_size) and the argument type is
|const void*| [1].  This patch fixes the argument type.

[1] https://opensource.apple.com/source/Libc/Libc-825.26/include/malloc/malloc.h.auto.html

Change-Id: I62e57d4f7bae1098db92ede760a1fdf44746d4a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2505334
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Reviewed-by: default avatarWill Harris <wfh@chromium.org>
Reviewed-by: default avatarBenoit L <lizeb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822607}
parent 6630cda5
...@@ -10,7 +10,11 @@ ...@@ -10,7 +10,11 @@
#endif #endif
#define BASE_ALLOCATOR_ALLOCATOR_SHIM_OVERRIDE_LIBC_SYMBOLS_H_ #define BASE_ALLOCATOR_ALLOCATOR_SHIM_OVERRIDE_LIBC_SYMBOLS_H_
#if defined(OS_APPLE)
#include <malloc/malloc.h>
#else
#include <malloc.h> #include <malloc.h>
#endif
#include "base/allocator/allocator_shim_internals.h" #include "base/allocator/allocator_shim_internals.h"
...@@ -56,7 +60,7 @@ SHIM_ALWAYS_EXPORT int posix_memalign(void** r, size_t a, size_t s) __THROW { ...@@ -56,7 +60,7 @@ SHIM_ALWAYS_EXPORT int posix_memalign(void** r, size_t a, size_t s) __THROW {
return ShimPosixMemalign(r, a, s); return ShimPosixMemalign(r, a, s);
} }
SHIM_ALWAYS_EXPORT size_t malloc_size(void* address) __THROW { SHIM_ALWAYS_EXPORT size_t malloc_size(const void* address) __THROW {
return ShimGetSizeEstimate(address, nullptr); return ShimGetSizeEstimate(address, nullptr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment