Skip to content

Commit 58bc49d

Browse files
togeprince-chrismc
authored andcommitted
(conan-io#14931) mimalloc: add version 1.7.9, 2.0.9
* mimalloc: add version 1.7.9, 2.0.9 * fix compilation error on msvc * use self.settings instead self.info.settings Co-authored-by: Chris Mc <[email protected]> * use self.settings instead of self.info.settings Co-authored-by: Chris Mc <[email protected]> * create patches for older compilers --------- Co-authored-by: Chris Mc <[email protected]>
1 parent aaf10f4 commit 58bc49d

7 files changed

+119
-8
lines changed

recipes/mimalloc/all/conandata.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
sources:
2+
"2.0.9":
3+
url: "https://github.com/microsoft/mimalloc/archive/v2.0.9.tar.gz"
4+
sha256: "4a29edae32a914a706715e2ac8e7e4109e25353212edeed0888f4e3e15db5850"
25
"2.0.7":
36
url: "https://github.com/microsoft/mimalloc/archive/v2.0.7.tar.gz"
47
sha256: "f23aac6c73594e417af50cb38f1efed88ef1dc14a490f0eff07c7f7b079810a4"
@@ -14,6 +17,9 @@ sources:
1417
"2.0.2":
1518
url: "https://github.com/microsoft/mimalloc/archive/v2.0.2.tar.gz"
1619
sha256: "c81a5f443f72373e3105172d6a935e29b0dabd13ba387c080bc444586cbe3021"
20+
"1.7.9":
21+
url: "https://github.com/microsoft/mimalloc/archive/v1.7.9.tar.gz"
22+
sha256: "45e05be518363d32b2cdcce1a1fac3580895ea2e4524e1a3c7e71145cb58659f"
1723
"1.7.7":
1824
url: "https://github.com/microsoft/mimalloc/archive/v1.7.7.tar.gz"
1925
sha256: "0f6663be1e1764851bf9563fcf7a6b3330e23b933eb4737dd07e3289b87895fe"
@@ -27,6 +33,13 @@ sources:
2733
url: "https://github.com/microsoft/mimalloc/archive/v1.6.7.tar.gz"
2834
sha256: "111b718b496f297f128d842880e72e90e33953cf00b45ba0ccd2167e7340ed17"
2935
patches:
36+
"2.0.9":
37+
- patch_file: "patches/2.0.9-0001-change-install-paths.patch"
38+
patch_description: "fix install paths"
39+
patch_type: "conan"
40+
- patch_file: "patches/2.0.9-0002-support-older-compiler.patch"
41+
patch_description: "fix compilation errors on older compilers"
42+
patch_type: "portability"
3043
"2.0.7":
3144
- patch_file: "patches/2.0.7-0001-change-install-paths.patch"
3245
patch_description: "fix install paths"
@@ -50,6 +63,13 @@ patches:
5063
- patch_file: "patches/2.0.2-0002-include-cstddef-to-get-std-size-t.patch"
5164
patch_description: "include stddef"
5265
patch_type: "portability"
66+
"1.7.9":
67+
- patch_file: "patches/1.7.9-0001-change-install-paths.patch"
68+
patch_description: "fix install paths"
69+
patch_type: "conan"
70+
- patch_file: "patches/1.7.9-0002-support-older-compiler.patch"
71+
patch_description: "fix compilation errors on older compilers"
72+
patch_type: "portability"
5373
"1.7.7":
5474
- patch_file: "patches/1.7.7-0001-change-install-paths.patch"
5575
patch_description: "fix install paths"

recipes/mimalloc/all/conanfile.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from conan import ConanFile
22
from conan.errors import ConanInvalidConfiguration
3-
from conan.tools.microsoft import check_min_vs, is_msvc, msvc_runtime_flag, VCVars
3+
from conan.tools.microsoft import is_msvc, msvc_runtime_flag, VCVars
44
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file, save, collect_libs
55
from conan.tools.build import check_min_cppstd
66
from conan.tools.scm import Version
@@ -48,6 +48,7 @@ def _compilers_minimum_version(self):
4848
return {
4949
"gcc": "7",
5050
"Visual Studio": "15",
51+
"msvc": "191",
5152
"clang": "5",
5253
"apple-clang": "10",
5354
}
@@ -111,13 +112,11 @@ def validate(self):
111112

112113
if self.info.settings.compiler.cppstd:
113114
check_min_cppstd(self, self._min_cppstd)
114-
check_min_vs(self, 191)
115-
if not is_msvc(self):
116-
minimum_version = self._compilers_minimum_version.get(str(self.info.settings.compiler), False)
117-
if minimum_version and Version(self.info.settings.compiler.version) < minimum_version:
118-
raise ConanInvalidConfiguration(
119-
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support."
120-
)
115+
minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
116+
if minimum_version and Version(self.settings.compiler.version) < minimum_version:
117+
raise ConanInvalidConfiguration(
118+
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support."
119+
)
121120

122121
def source(self):
123122
get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 0011b87..41a15a2 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -383,7 +383,7 @@ if(MI_BUILD_SHARED)
6+
install(FILES "$<TARGET_FILE_DIR:mimalloc>/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" DESTINATION ${mi_install_libdir})
7+
endif()
8+
9+
- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY)
10+
+ install(TARGETS mimalloc EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
11+
install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir})
12+
endif()
13+
14+
@@ -407,7 +407,7 @@ if (MI_BUILD_STATIC)
15+
set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename})
16+
endif()
17+
18+
- install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_objdir} LIBRARY)
19+
+ install(TARGETS mimalloc-static EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
20+
install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir})
21+
endif()
22+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/include/mimalloc.h b/include/mimalloc.h
2+
index f590033..a4275c5 100644
3+
--- a/include/mimalloc.h
4+
+++ b/include/mimalloc.h
5+
@@ -493,7 +493,7 @@ template<class T, bool destroy> struct _mi_heap_stl_allocator_common : public _m
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, 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+
@@ -504,7 +504,7 @@ protected:
15+
this->heap.reset(hp, (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, 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+
private:
22+
static void heap_delete(mi_heap_t* hp) { if (hp != NULL) { mi_heap_delete(hp); } }
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 74c1f29..d657144 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -383,7 +383,7 @@ if(MI_BUILD_SHARED)
6+
install(FILES "$<TARGET_FILE_DIR:mimalloc>/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" DESTINATION ${mi_install_libdir})
7+
endif()
8+
9+
- install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY)
10+
+ install(TARGETS mimalloc EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
11+
install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir})
12+
endif()
13+
14+
@@ -407,7 +407,7 @@ if (MI_BUILD_STATIC)
15+
set_target_properties(mimalloc-static PROPERTIES OUTPUT_NAME ${mi_basename})
16+
endif()
17+
18+
- install(TARGETS mimalloc-static EXPORT mimalloc DESTINATION ${mi_install_objdir} LIBRARY)
19+
+ install(TARGETS mimalloc-static EXPORT mimalloc RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
20+
install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir})
21+
endif()
22+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/include/mimalloc.h b/include/mimalloc.h
2+
index 9b72fbf..b34362f 100644
3+
--- a/include/mimalloc.h
4+
+++ b/include/mimalloc.h
5+
@@ -500,7 +500,7 @@ template<class T, bool destroy> struct _mi_heap_stl_allocator_common : public _m
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, 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+
@@ -511,7 +511,7 @@ protected:
15+
this->heap.reset(hp, (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, 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+
private:
22+
static void heap_delete(mi_heap_t* hp) { if (hp != NULL) { mi_heap_delete(hp); } }

recipes/mimalloc/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
versions:
2+
"2.0.9":
3+
folder: all
24
"2.0.7":
35
folder: all
46
"2.0.6":
@@ -9,6 +11,8 @@ versions:
911
folder: all
1012
"2.0.2":
1113
folder: all
14+
"1.7.9":
15+
folder: all
1216
"1.7.7":
1317
folder: all
1418
"1.7.6":

0 commit comments

Comments
 (0)