mirror of
https://github.com/openwrt/packages.git
synced 2026-05-31 06:51:51 +08:00
75d4b7a129
Stable bug-fix release in the 2.03.x series. The bundled device-mapper library bumps from 1.02.209 to 1.02.215; track that in PKG_VERSION_DM as well so the libdevmapper package shows the correct upstream version. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
46 lines
1.1 KiB
Diff
46 lines
1.1 KiB
Diff
--- a/lib/mm/memlock.c
|
|
+++ b/lib/mm/memlock.c
|
|
@@ -209,12 +209,15 @@ static void _allocate_memory(void)
|
|
* memory on free(), this is good enough for our purposes.
|
|
*/
|
|
while (missing > 0) {
|
|
+#ifdef __GLIBC__
|
|
struct MALLINFO inf = MALLINFO();
|
|
hblks = inf.hblks;
|
|
+#endif
|
|
|
|
if ((areas[area] = malloc(alloc_size)))
|
|
_touch_memory(areas[area], alloc_size);
|
|
|
|
+#ifdef __GLIBC__
|
|
inf = MALLINFO();
|
|
|
|
if (hblks < inf.hblks) {
|
|
@@ -224,9 +227,12 @@ static void _allocate_memory(void)
|
|
free(areas[area]);
|
|
alloc_size /= 2;
|
|
} else {
|
|
+#endif
|
|
++ area;
|
|
missing -= alloc_size;
|
|
+#ifdef __GLIBC__
|
|
}
|
|
+#endif
|
|
|
|
if (area == MAX_AREAS && missing > 0) {
|
|
/* Too bad. Warn the user and proceed, as things are
|
|
@@ -560,8 +566,13 @@ static void _lock_mem(struct cmd_context
|
|
* will not block memory locked thread
|
|
* Note: assuming _memlock_count_daemon is updated before _memlock_count
|
|
*/
|
|
+#ifdef __GLIBC__
|
|
_use_mlockall = _memlock_count_daemon ? 1 :
|
|
find_config_tree_bool(cmd, activation_use_mlockall_CFG, NULL);
|
|
+#else
|
|
+ /* always use mlockall on musl */
|
|
+ _use_mlockall = 1;
|
|
+#endif
|
|
|
|
if (!_use_mlockall) {
|
|
if (!*_procselfmaps &&
|