Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 1 | From 52c1586bff0ecb418ac21d6678f8963d70959f04 Mon Sep 17 00:00:00 2001 |
| 2 | From: Naveen Saini <naveen.kumar.saini@intel.com> |
| 3 | Date: Wed, 7 Apr 2021 11:14:13 +0800 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 4 | Subject: [PATCH] mallinfo() is glibc specific API mark it so |
| 5 | |
| 6 | Helps compiling with musl |
| 7 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 8 | Upstream-Status: Pending |
| 9 | |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 11 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> |
| 12 | --- |
| 13 | src/tbbmalloc_proxy/proxy.cpp | 2 ++ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 14 | 1 file changed, 2 insertions(+) |
| 15 | |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 16 | --- a/src/tbbmalloc_proxy/proxy.cpp |
| 17 | +++ b/src/tbbmalloc_proxy/proxy.cpp |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 18 | @@ -260,6 +260,7 @@ int mallopt(int /*param*/, int /*value*/ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 19 | return 1; |
| 20 | } |
| 21 | |
| 22 | +#ifdef __GLIBC__ |
| 23 | struct mallinfo mallinfo() __THROW |
| 24 | { |
| 25 | struct mallinfo m; |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 26 | @@ -267,6 +268,7 @@ struct mallinfo mallinfo() __THROW |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 27 | |
| 28 | return m; |
| 29 | } |
| 30 | +#endif |
| 31 | |
| 32 | #if __ANDROID__ |
| 33 | // Android doesn't have malloc_usable_size, provide it to be compatible |