python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / squeezelite / 0002-output_alsa-use-mallopt-only-on-glibc.patch
blob6962b7b8fd0acaf025e732cda3da93aa69ab20bd
1 From 903922a7bcf06e04d9830b47bba6d65ed37304c1 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Sun, 7 Feb 2016 18:05:56 +0100
4 Subject: [PATCH] output_alsa: use mallopt() only on glibc
6 The musl C library does not provide the glibc specific mallopt()
7 functionality, so use it only when __GLIBC__ is defined.
9 uClibc pretends to be glibc by defining __GLIBC__, but it implements
10 mallopt(), so it works fine.
12 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
13 ---
14 output_alsa.c | 2 ++
15 1 file changed, 2 insertions(+)
17 diff --git a/output_alsa.c b/output_alsa.c
18 index aa01560..44c9fc7 100644
19 --- a/output_alsa.c
20 +++ b/output_alsa.c
21 @@ -862,8 +862,10 @@ void output_init_alsa(log_level level, const char *device, unsigned output_buf_s
22 LOG_INFO("memory locked");
25 +#ifdef __GLIBC__
26 mallopt(M_TRIM_THRESHOLD, -1);
27 mallopt(M_MMAP_MAX, 0);
28 +#endif
30 touch_memory(silencebuf, MAX_SILENCE_FRAMES * BYTES_PER_FRAME);
31 touch_memory(outputbuf->buf, outputbuf->size);
32 --
33 2.6.4