Skip to content

Commit bfdc0c3

Browse files
togeperseoGI
andauthored
mimalloc: add version 2.1.9 (conan-io#26350)
* mimalloc: add version 2.1.9 * add guard option * Renamed guard to guarded new option and fix incorrect value --------- Co-authored-by: PerseoGI <[email protected]>
1 parent 8c83329 commit bfdc0c3

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

recipes/mimalloc/all/conandata.yml

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
sources:
2+
"2.1.9":
3+
url: "https://github.com/microsoft/mimalloc/archive/v2.1.9.tar.gz"
4+
sha256: "dd8ff701691f19bf4e225d42ef0d3d5e6ca0e03498ee4f044a0402e4697e4a20"
25
"2.1.7":
36
url: "https://github.com/microsoft/mimalloc/archive/v2.1.7.tar.gz"
47
sha256: "0eed39319f139afde8515010ff59baf24de9e47ea316a315398e8027d198202d"
@@ -21,6 +24,10 @@ sources:
2124
url: "https://github.com/microsoft/mimalloc/archive/v1.7.6.tar.gz"
2225
sha256: "d74f86ada2329016068bc5a243268f1f555edd620b6a7d6ce89295e7d6cf18da"
2326
patches:
27+
"2.1.9":
28+
- patch_file: "patches/2.1.9-0002-support-older-compiler.patch"
29+
patch_description: "fix compilation errors on older compilers"
30+
patch_type: "portability"
2431
"2.1.7":
2532
- patch_file: "patches/2.1.7-0002-support-older-compiler.patch"
2633
patch_description: "fix compilation errors on older compilers"

recipes/mimalloc/all/conanfile.py

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class MimallocConan(ConanFile):
2727
"override": [True, False],
2828
"inject": [True, False],
2929
"single_object": [True, False],
30+
"guarded": [True, False],
3031
"win_redirect": [True, False],
3132
}
3233
default_options = {
@@ -36,6 +37,7 @@ class MimallocConan(ConanFile):
3637
"override": False,
3738
"inject": False,
3839
"single_object": False,
40+
"guarded": False,
3941
"win_redirect": False,
4042
}
4143

@@ -53,6 +55,8 @@ def config_options(self):
5355
if is_msvc(self):
5456
del self.options.single_object
5557
del self.options.inject
58+
if Version(self.version) < "2.1.9":
59+
del self.options.guarded
5660

5761
def configure(self):
5862
if self.options.shared:
@@ -123,6 +127,7 @@ def generate(self):
123127
tc.variables["MI_SECURE"] = "ON" if self.options.secure else "OFF"
124128
tc.variables["MI_WIN_REDIRECT"] = "ON" if self.options.get_safe("win_redirect") else "OFF"
125129
tc.variables["MI_INSTALL_TOPLEVEL"] = "ON"
130+
tc.variables["MI_GUARDED"] = self.options.get_safe("guarded", False)
126131
tc.generate()
127132
venv = VirtualBuildEnv(self)
128133
venv.generate(scope="build")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/include/mimalloc.h b/include/mimalloc.h
2+
index bd91db4..f6aa1aa 100644
3+
--- a/include/mimalloc.h
4+
+++ b/include/mimalloc.h
5+
@@ -544,7 +544,7 @@ template<class T, bool _mi_destroy> struct _mi_heap_stl_allocator_common : publi
6+
#endif
7+
8+
void collect(bool force) { mi_heap_collect(this->heap.get(), force); }
9+
- template<class U> bool is_equal(const _mi_heap_stl_allocator_common<U, _mi_destroy>& x) const { return (this->heap == x.heap); }
10+
+ template<class U, bool b> bool is_equal(const _mi_heap_stl_allocator_common<U, b>& x) const { return (this->heap == x.heap); }
11+
12+
protected:
13+
std::shared_ptr<mi_heap_t> heap;
14+
@@ -555,7 +555,8 @@ protected:
15+
this->heap.reset(hp, (_mi_destroy ? &heap_destroy : &heap_delete)); /* calls heap_delete/destroy when the refcount drops to zero */
16+
}
17+
_mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common& x) mi_attr_noexcept : heap(x.heap) { }
18+
- template<class U> _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common<U, _mi_destroy>& x) mi_attr_noexcept : heap(x.heap) { }
19+
+ template<class U, bool b> _mi_heap_stl_allocator_common(const _mi_heap_stl_allocator_common<U, b>& x) mi_attr_noexcept : heap(x.heap)
20+
+ { }
21+
22+
private:
23+
static void heap_delete(mi_heap_t* hp) { if (hp != NULL) { mi_heap_delete(hp); } }

recipes/mimalloc/config.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
versions:
2+
"2.1.9":
3+
folder: all
24
"2.1.7":
35
folder: all
46
# mold requires 2.1.2

0 commit comments

Comments
 (0)