diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch')
-rw-r--r-- | meta/recipes-core/systemd/systemd/0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/meta/recipes-core/systemd/systemd/0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch b/meta/recipes-core/systemd/systemd/0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch deleted file mode 100644 index b83fffe793..0000000000 --- a/meta/recipes-core/systemd/systemd/0020-sd-event-Make-malloc_trim-conditional-on-glibc.patch +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | From 9eb4867b4e2dbdb2484ae854022aff97e2f0feb3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 2 Aug 2023 12:06:27 -0700 | ||
4 | Subject: [PATCH 20/22] sd-event: Make malloc_trim() conditional on glibc | ||
5 | |||
6 | musl does not have this API | ||
7 | |||
8 | Upstream-Status: Inappropriate [musl-specific] | ||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | src/libsystemd/sd-event/sd-event.c | 4 +++- | ||
12 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c | ||
15 | index 288798a0dc..6419a7f216 100644 | ||
16 | --- a/src/libsystemd/sd-event/sd-event.c | ||
17 | +++ b/src/libsystemd/sd-event/sd-event.c | ||
18 | @@ -1874,7 +1874,7 @@ _public_ int sd_event_add_exit( | ||
19 | } | ||
20 | |||
21 | _public_ int sd_event_trim_memory(void) { | ||
22 | - int r; | ||
23 | + int r = 0; | ||
24 | |||
25 | /* A default implementation of a memory pressure callback. Simply releases our own allocation caches | ||
26 | * and glibc's. This is automatically used when people call sd_event_add_memory_pressure() with a | ||
27 | @@ -1888,7 +1888,9 @@ _public_ int sd_event_trim_memory(void) { | ||
28 | |||
29 | usec_t before_timestamp = now(CLOCK_MONOTONIC); | ||
30 | hashmap_trim_pools(); | ||
31 | +#ifdef __GLIBC__ | ||
32 | r = malloc_trim(0); | ||
33 | +#endif | ||
34 | usec_t after_timestamp = now(CLOCK_MONOTONIC); | ||
35 | |||
36 | if (r > 0) | ||
37 | -- | ||
38 | 2.34.1 | ||
39 | |||