mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2026-05-28 18:06:32 +03:00
musl: allocator: Fix __THROW and mallinfo
This commit is contained in:
@@ -1134,7 +1134,9 @@ SHIM_ALWAYS_EXPORT int mallopt(int cmd, int value) __THROW {
|
||||
|
||||
#endif // !PA_BUILDFLAG(IS_APPLE) && !PA_BUILDFLAG(IS_ANDROID)
|
||||
|
||||
#if PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_CHROMEOS)
|
||||
#if defined(__MUSL__)
|
||||
// Musl does not support struct mallinfo.
|
||||
#elif PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_CHROMEOS)
|
||||
SHIM_ALWAYS_EXPORT struct mallinfo mallinfo(void) __THROW {
|
||||
partition_alloc::SimplePartitionStatsDumper allocator_dumper;
|
||||
// TODO(crbug.com/477186304): Dump stats for all alloc tokens, by accumulating
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
|
||||
#if defined(__GNUC__)
|
||||
|
||||
#if PA_BUILDFLAG(IS_POSIX)
|
||||
#if defined(__MUSL__)
|
||||
// Musl does not provide sys/cdefs.h
|
||||
#elif PA_BUILDFLAG(IS_POSIX)
|
||||
#include <sys/cdefs.h> // for __THROW
|
||||
#endif
|
||||
|
||||
|
||||
@@ -25,6 +25,12 @@
|
||||
|
||||
#include "partition_alloc/shim/allocator_shim_internals.h"
|
||||
|
||||
// Musl does not specify anything for malloc() etc.
|
||||
#if defined(__MUSL__)
|
||||
#undef __THROW
|
||||
#define __THROW
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
|
||||
// WARNING: Whenever a new function is added there (which, surprisingly enough,
|
||||
|
||||
Reference in New Issue
Block a user