[compiler-rt] Move __sanitizer_mallinfo to separate header
authorLeonard Chan <leonardchan@google.com>
Wed, 29 Mar 2023 17:08:22 +0000 (17:08 +0000)
committerLeonard Chan <leonardchan@google.com>
Wed, 29 Mar 2023 17:09:06 +0000 (17:09 +0000)
commit99db65630c8595d248467bf3311596034c168556
tree30cbb161fdb209582cd75166ed744ea028443659
parentce6a03ce0b82dbebcf5c752bade0955dc3abb2ba
[compiler-rt] Move __sanitizer_mallinfo to separate header

mallinfo is platform-specific and not specified by either posix or the C
standard, but the hwasan interface unconditionally exposes
__sanitizer_mallinfo which returns a struct __sanitizer_struct_mallinfo
which is defined in sanitizer_platform_limits_posix.h, so this should
also be available for fuchsia to provide __sanitizer_mallinfo. Fuchsia
doesn't need the rest of what's in sanitizer_platform_limits_posix.h so
we can just move it to its own header.

Exposing this and not forcing it to hide behind
SANITIZER_INTERCEPT_MALLOPT_AND_MALLINFO fixes the test failures found
after landing D145718.

Differential Revision: https://reviews.llvm.org/D147092
compiler-rt/lib/sanitizer_common/sanitizer_mallinfo.h [new file with mode: 0644]
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h