new(cmake,userspace/falco): add mimalloc allocator library support.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
This commit is contained in:
Federico Di Pierro
2025-06-13 10:37:05 +02:00
committed by poiana
parent cf792a0700
commit 6a4fa5dfce
5 changed files with 129 additions and 23 deletions

View File

@@ -70,9 +70,9 @@ set(FALCO_INCLUDE_DIRECTORIES
set(FALCO_DEPENDENCIES cxxopts)
set(FALCO_LIBRARIES falco_engine)
if(USE_JEMALLOC)
list(APPEND FALCO_DEPENDENCIES jemalloc)
list(APPEND FALCO_LIBRARIES ${JEMALLOC_LIB})
if(USE_JEMALLOC OR USE_MIMALLOC)
list(APPEND FALCO_DEPENDENCIES malloc)
list(APPEND FALCO_LIBRARIES ${MALLOC_LIB})
endif()
if(NOT WIN32)

View File

@@ -15,6 +15,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
#ifdef HAS_MIMALLOC
#include <mimalloc-new-delete.h>
#endif
#include <stdio.h>
#include <string>