mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-22 05:16:12 +03:00
musl: base: Remove use of mallinfo
This commit is contained in:
parent
412406331a
commit
d5c9fe6a41
@ -110,6 +110,9 @@ void IncreaseFdLimitTo(unsigned int max_descriptors) {
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
size_t GetMallocUsageMallinfo() {
|
size_t GetMallocUsageMallinfo() {
|
||||||
|
#if defined(__MUSL__)
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
|
#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
|
||||||
#if __GLIBC_PREREQ(2, 33)
|
#if __GLIBC_PREREQ(2, 33)
|
||||||
#define MALLINFO2_FOUND_IN_LIBC
|
#define MALLINFO2_FOUND_IN_LIBC
|
||||||
@ -121,6 +124,7 @@ size_t GetMallocUsageMallinfo() {
|
|||||||
#endif
|
#endif
|
||||||
#undef MALLINFO2_FOUND_IN_LIBC
|
#undef MALLINFO2_FOUND_IN_LIBC
|
||||||
return checked_cast<size_t>(minfo.hblkhd + minfo.arena);
|
return checked_cast<size_t>(minfo.hblkhd + minfo.arena);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -368,6 +368,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
|
|||||||
&allocated_objects_count);
|
&allocated_objects_count);
|
||||||
#elif BUILDFLAG(IS_FUCHSIA)
|
#elif BUILDFLAG(IS_FUCHSIA)
|
||||||
// TODO(fuchsia): Port, see https://crbug.com/706592.
|
// TODO(fuchsia): Port, see https://crbug.com/706592.
|
||||||
|
#elif defined(__MUSL__)
|
||||||
#else
|
#else
|
||||||
ReportMallinfoStats(/*pmd=*/nullptr, &total_virtual_size, &resident_size,
|
ReportMallinfoStats(/*pmd=*/nullptr, &total_virtual_size, &resident_size,
|
||||||
&allocated_objects_size, &allocated_objects_count);
|
&allocated_objects_size, &allocated_objects_count);
|
||||||
|
Loading…
Reference in New Issue
Block a user