pmaports/maemo/libosso/libosso-mem-musl.patch
NotKit 739970777f Package more Maemo packages and switch upstream to maemo-leste (#1015)
* Package more maemo apps/libs (including Maemo X Terminal osso-xterm)
* Put libhildondesktop examples into separate package
* Change upstream url in Maemo packages to https://github.com/maemo-leste
Update hildon-desktop and iphbd to their newer repo versions. This includes the fix for the bug when switching between multiple windows in hildon-desktop.
* Use version tags instead of specific commits for Maemo packages
2017-12-19 01:19:17 +00:00

52 lines
1.6 KiB
Diff

diff --git a/src/osso-mem.c b/src/osso-mem.c
index 17fd5e2..0c74e3e 100644
--- a/src/osso-mem.c
+++ b/src/osso-mem.c
@@ -287,6 +287,7 @@ static void setup_sys_values(void)
} /* setup_sys_values */
+#if defined(__GLIBC__)
/* ------------------------------------------------------------------------- *
* saw_malloc_hook - Malloc hook. Executed when osso_mem_saw_active is in
* place. Thread-safe (= slow in some cases).
@@ -337,7 +338,7 @@ static void* saw_malloc_hook(size_t size, const void* caller)
return ptr;
} /* saw_malloc_hook */
-
+#endif
/* ========================================================================= *
* Public methods.
@@ -583,6 +584,7 @@ int osso_mem_saw_enable(size_t threshold,
/* If we're below the threshold, don't make things worse */
if(threshold > 0 && available > threshold)
{
+#if defined(__GLIBC__)
const struct mallinfo mi = mallinfo();
THREAD_LOCK();
@@ -602,6 +604,7 @@ int osso_mem_saw_enable(size_t threshold,
ULOG_INFO_F("SAW hook installed: block size %u, maxheap %u (threshold %u)",
saw_max_block_size, saw_max_heap_size, threshold);
+#endif
return 0;
}
@@ -621,12 +624,14 @@ int osso_mem_saw_enable(size_t threshold,
* ------------------------------------------------------------------------- */
void osso_mem_saw_disable(void)
{
+#if defined(__GLIBC__)
THREAD_LOCK();
if(saw_malloc_hook == __malloc_hook)
__malloc_hook = saw_old_malloc_hook;
THREAD_UNLOCK();
ULOG_INFO_F("SAW hook removed!");
+#endif
} /* osso_mem_saw_disable */