Mercurial > hg > orthanc
diff OrthancServer/CMakeLists.txt @ 5159:f5907aecbaed
conditional usage of malloc_trim
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 02 Feb 2023 11:28:35 +0100 |
parents | f2dcdbe05884 |
children | 0ea402b4d901 |
line wrap: on
line diff
--- a/OrthancServer/CMakeLists.txt Thu Feb 02 10:33:15 2023 +0100 +++ b/OrthancServer/CMakeLists.txt Thu Feb 02 11:28:35 2023 +0100 @@ -281,6 +281,7 @@ ##################################################################### check_symbol_exists(mallopt "malloc.h" HAVE_MALLOPT) +check_symbol_exists(malloc_trim "malloc.h" HAVE_MALLOC_TRIM) if (HAVE_MALLOPT) add_definitions(-DHAVE_MALLOPT=1) @@ -288,6 +289,11 @@ add_definitions(-DHAVE_MALLOPT=0) endif() +if (HAVE_MALLOC_TRIM) + add_definitions(-DHAVE_MALLOC_TRIM=1) +else() + add_definitions(-DHAVE_MALLOC_TRIM=0) +endif() if (STATIC_BUILD) add_definitions(-DORTHANC_STATIC=1)