summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2022-08-19 16:15:17 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2022-08-30 13:55:52 +0200
commit8370d117d7ef8a472c95315a3cd085696c90b3be (patch)
treec8ce9cd6b4787f0be28751806d36f8b3f06d57c2 /lib
parent5aa8683e8693f405d560b93a1bd8de809dc985ef (diff)
downloadlvm2-8370d117d7ef8a472c95315a3cd085696c90b3be.tar.gz
mm: preallocate memory only with glibc
Use mallinfo() only with glibc.
Diffstat (limited to 'lib')
-rw-r--r--lib/mm/memlock.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c
index f43bacdcd..4a202866a 100644
--- a/lib/mm/memlock.c
+++ b/lib/mm/memlock.c
@@ -159,7 +159,12 @@ static void _touch_memory(void *mem, size_t size)
static void _allocate_memory(void)
{
-#ifndef VALGRIND_POOL
+#if defined(__GLIBC__) && !defined(VALGRIND_POOL)
+ /* Memory allocation is currently only tested with glibc
+ * for different C libraries, some other mechanisms might be needed
+ * meanwhile let users use lvm2 code without memory preallocation.
+ * Compilation for VALGRIND tracing also goes without preallocation.
+ */
void *stack_mem;
struct rlimit limit;
int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks;