From 59b2954ff4b4ac24a223c32614c874fd7de0623c Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Sat, 6 Apr 2024 11:09:32 +0200 Subject: [PATCH] deps: add mimalloc dependency --- .gitmodules | 3 +++ Makefile | 23 +++++++++++++++++++++-- vendor/mimalloc | 1 + 3 files changed, 25 insertions(+), 2 deletions(-) create mode 160000 vendor/mimalloc diff --git a/.gitmodules b/.gitmodules index 96990845..3aa7f9fb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,3 +19,6 @@ [submodule "tests/wpt"] path = tests/wpt url = https://github.com/lightpanda-io/wpt +[submodule "vendor/mimalloc"] + path = vendor/mimalloc + url = git@github.com:microsoft/mimalloc.git diff --git a/Makefile b/Makefile index 8c44a36e..61283568 100644 --- a/Makefile +++ b/Makefile @@ -95,13 +95,14 @@ test: .PHONY: install-submodule .PHONY: install-jsruntime install-jsruntime-dev install-libiconv .PHONY: _install-netsurf install-netsurf clean-netsurf test-netsurf install-netsurf-dev +.PHONY: install-mimalloc install-mimalloc-dev clean-mimalloc .PHONY: install-dev install ## Install and build dependencies for release -install: install-submodule install-jsruntime install-netsurf +install: install-submodule install-jsruntime install-netsurf install-mimalloc ## Install and build dependencies for dev -install-dev: install-submodule install-jsruntime-dev install-netsurf-dev +install-dev: install-submodule install-jsruntime-dev install-netsurf-dev install-mimalloc-dev install-netsurf-dev: _install-netsurf install-netsurf-dev: OPTCFLAGS := -O0 -g -DNDEBUG @@ -185,6 +186,24 @@ install-jsruntime: @cd vendor/jsruntime-lib && \ make install +install-mimalloc-dev: + @cd vendor/mimalloc && \ + mkdir -p out && \ + cd out && \ + cmake -DCMAKE_BUILD_TYPE=Debug .. && \ + make mimalloc-static && \ + mv libmimalloc-debug.a libmimalloc.a + +install-mimalloc: + @cd vendor/mimalloc && \ + mkdir -p out && \ + cd out && \ + cmake .. && \ + make mimalloc-static + +clean-mimalloc: + rm -fr vendor/mimalloc/lib/* + ## Init and update git submodule install-submodule: @git submodule init && \ diff --git a/vendor/mimalloc b/vendor/mimalloc new file mode 160000 index 00000000..8f7d1e9a --- /dev/null +++ b/vendor/mimalloc @@ -0,0 +1 @@ +Subproject commit 8f7d1e9a41bb0182166aac6a8d4d8b00f60ed032