File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ conan_cmake_configure(
3737 "catch2/2.13.9@#8793d3e6287d3684201418de556d98fe"
3838 "flatbuffers/23.5.26@#b153646f6546daab4c7326970b6cd89c"
3939 "hiredis/1.0.2@#370dad964286cadb1f15dc90252e8ef3"
40+ "mimalloc/2.1.2@#93a294cba11166006270536859c3c9ef"
4041 "openssl/3.0.2@#269fa93e5afe8c34bd9a0030d2b8f0fe"
4142 "protobuf/3.20.0@#8e4de7081bea093469c9e6076149b2b4"
4243 "readerwriterqueue/1.0.6@#a95c8da3d68822dec4d4c13fff4b5c96"
@@ -79,6 +80,7 @@ find_package(Catch2 REQUIRED)
7980find_package (flatbuffers REQUIRED)
8081find_package (fmt REQUIRED)
8182find_package (hiredis REQUIRED)
83+ find_package (mimalloc 2.1.2 REQUIRED)
8284# 27/01/2023 - Pin OpenSSL to a specific version to avoid incompatibilities
8385# with the system's (i.e. Ubuntu 22.04) OpenSSL
8486find_package (OpenSSL 3.0.2 REQUIRED)
@@ -145,6 +147,7 @@ target_link_libraries(faabric_common_dependencies INTERFACE
145147 Boost::system
146148 flatbuffers::flatbuffers
147149 hiredis::hiredis
150+ mimalloc::mimalloc
148151 nng::nng
149152 protobuf::libprotobuf
150153 readerwriterqueue::readerwriterqueue
Original file line number Diff line number Diff line change 33#include < cstdint>
44#include < functional>
55#include < memory>
6+ #include < mimalloc.h>
67#include < span>
78#include < string>
89#include < unistd.h>
@@ -15,17 +16,17 @@ namespace faabric::util {
1516// malloc implementations.
1617inline void * malloc (std::size_t size)
1718{
18- return std::malloc (size);
19+ return mi_malloc (size);
1920}
2021
2122inline void free (void * ptr)
2223{
23- return std::free (ptr);
24+ return mi_free (ptr);
2425}
2526
2627inline void * realloc (void * ptr, std::size_t newSize)
2728{
28- return std::realloc (ptr, newSize);
29+ return mi_realloc (ptr, newSize);
2930}
3031
3132/*
You can’t perform that action at this time.
0 commit comments