Commit e597da50 authored by Yuki Shiino's avatar Yuki Shiino Committed by Commit Bot

base/allocator: Remove malloc_stats and mallopt when OS_APPLE

macOS and iOS do not support malloc_stats and mallopt, plus we'll
hit the following error if we define them.

../../chrome/tools/build/mac/verify_order: unordered symbols in Chromium Framework.framework/Versions/87.0.4260.0/Chromium Framework:
_malloc_stats
_mallopt

So, this patch removes them when OS_APPLE.

Bug: 998048
Change-Id: I5820670ce7b77d19b4f80acded73b3703b8aa478
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2400584Reviewed-by: default avatarBenoit L <lizeb@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805819}
parent a5be66c2
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "base/allocator/partition_allocator/partition_alloc.h" #include "base/allocator/partition_allocator/partition_alloc.h"
#include "base/bits.h" #include "base/bits.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "build/build_config.h"
namespace { namespace {
...@@ -149,12 +150,16 @@ constexpr AllocatorDispatch AllocatorDispatch::default_dispatch = { ...@@ -149,12 +150,16 @@ constexpr AllocatorDispatch AllocatorDispatch::default_dispatch = {
extern "C" { extern "C" {
#if !defined(OS_APPLE)
SHIM_ALWAYS_EXPORT void malloc_stats(void) __THROW {} SHIM_ALWAYS_EXPORT void malloc_stats(void) __THROW {}
SHIM_ALWAYS_EXPORT int mallopt(int cmd, int value) __THROW { SHIM_ALWAYS_EXPORT int mallopt(int cmd, int value) __THROW {
return 0; return 0;
} }
#endif // !defined(OS_APPLE)
#ifdef HAVE_STRUCT_MALLINFO #ifdef HAVE_STRUCT_MALLINFO
SHIM_ALWAYS_EXPORT struct mallinfo mallinfo(void) __THROW { SHIM_ALWAYS_EXPORT struct mallinfo mallinfo(void) __THROW {
return {}; return {};
......
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