diff --git a/common/shlibs b/common/shlibs
index c71817b11b5..a521ea1b66a 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4323,3 +4323,4 @@ libjxl_threads.so.0.8 libjxl-0.8.2_1
 libtext-engine-0.1.so.0 text-engine-0.1.1_1
 libvmaf.so.1 vmaf-2.3.1_1
 liblc3.so.1 liblc3-1.0.3_1
+libmimalloc.so.2 mimalloc-2.1.2_1
diff --git a/srcpkgs/mimalloc-devel b/srcpkgs/mimalloc-devel
new file mode 120000
index 00000000000..9af584a917a
--- /dev/null
+++ b/srcpkgs/mimalloc-devel
@@ -0,0 +1 @@
+mimalloc
\ No newline at end of file
diff --git a/srcpkgs/mimalloc/patches/unify-library-name.patch b/srcpkgs/mimalloc/patches/unify-library-name.patch
new file mode 100644
index 00000000000..586edbd1426
--- /dev/null
+++ b/srcpkgs/mimalloc/patches/unify-library-name.patch
@@ -0,0 +1,20 @@
+make sure the library name is the same no matter whether is built as
+secure or not
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -343,15 +343,6 @@ else()
+ endif()
+ 
+ set(mi_basename "mimalloc")
+-if(MI_SECURE)
+-  set(mi_basename "${mi_basename}-secure")
+-endif()
+-if(MI_TRACK_VALGRIND)
+-  set(mi_basename "${mi_basename}-valgrind")
+-endif()
+-if(MI_TRACK_ASAN)
+-  set(mi_basename "${mi_basename}-asan")
+-endif()
+ string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LC)
+ if(NOT(CMAKE_BUILD_TYPE_LC MATCHES "^(release|relwithdebinfo|minsizerel|none)$"))
+   set(mi_basename "${mi_basename}-${CMAKE_BUILD_TYPE_LC}") #append build type (e.g. -debug) if not a release version
diff --git a/srcpkgs/mimalloc/template b/srcpkgs/mimalloc/template
new file mode 100644
index 00000000000..1c8872823b1
--- /dev/null
+++ b/srcpkgs/mimalloc/template
@@ -0,0 +1,36 @@
+# Template file for 'mimalloc'
+pkgname=mimalloc
+version=2.1.2
+revision=1
+build_style=cmake
+configure_args="$(vopt_bool secure MI_SECURE)"
+short_desc="General purpose allocator with excellent performance characteristics"
+maintainer="Peter Wang <novalazy@gmail.com>"
+license="MIT"
+homepage="https://github.com/microsoft/mimalloc"
+distfiles="https://github.com/microsoft/mimalloc/archive/v${version}.tar.gz"
+checksum=2b1bff6f717f9725c70bf8d79e4786da13de8a270059e4ba0bdd262ae7be46eb
+
+build_options="secure"
+build_options_default="secure"
+desc_option_secure="Build mimalloc in secure mode"
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+fi
+
+post_install() {
+	vlicense LICENSE
+}
+
+mimalloc-devel_package() {
+	depends="${sourcepkg}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/lib/cmake
+		vmove usr/lib/libmimalloc.so
+		vmove usr/lib/mimalloc-${version%.*}
+		vmove usr/lib/pkgconfig
+	}
+}