From b4e441654479304c043f2d2c4552ec62a3570ff7 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 5 Nov 2025 03:43:50 +0000 Subject: [PATCH] Add mimalloc-bench submodule and simplify larson_hakmem build Changes: - Add mimalloc-bench as git submodule for Larson benchmark source - Simplify Makefile: Remove shim layer (hakmem.o provides malloc/free directly) - Enable larson.sh script to build and run Larson benchmarks This allows running: ./scripts/larson.sh hakmem --profile tinyhot_tput 2 4 --- .gitmodules | 3 +++ Makefile | 11 ++++------- mimalloc-bench | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 .gitmodules create mode 160000 mimalloc-bench diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..dfb7a75d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "mimalloc-bench"] + path = mimalloc-bench + url = https://github.com/daanx/mimalloc-bench.git diff --git a/Makefile b/Makefile index e63110c6..bd1c4442 100644 --- a/Makefile +++ b/Makefile @@ -328,14 +328,11 @@ larson_mi.o: $(LARSON_SRC) larson_mi: larson_mi.o $(CXX) -o $@ $^ -L mimalloc-bench/extern/mi/out/release -lmimalloc $(LDFLAGS) -# HAKMEM variant (override malloc/free to our front via shim, link core) -bench_larson_hakmem_shim.o: bench_larson_hakmem_shim.c bench/larson_hakmem_shim.h - $(CC) $(CFLAGS) -I core -c -o $@ $< +# HAKMEM variant (hakmem.o provides malloc/free symbols directly) +larson_hakmem.o: $(LARSON_SRC) + $(CXX) $(CFLAGS) -I core -c -o $@ $< -larson_hakmem.o: $(LARSON_SRC) bench/larson_hakmem_shim.h - $(CXX) $(CFLAGS) -I core -include bench/larson_hakmem_shim.h -c -o $@ $< - -larson_hakmem: larson_hakmem.o bench_larson_hakmem_shim.o $(TINY_BENCH_OBJS) +larson_hakmem: larson_hakmem.o $(TINY_BENCH_OBJS) $(CXX) -o $@ $^ $(LDFLAGS) test_mf2: test_mf2.o $(TINY_BENCH_OBJS) diff --git a/mimalloc-bench b/mimalloc-bench new file mode 160000 index 00000000..6ec12891 --- /dev/null +++ b/mimalloc-bench @@ -0,0 +1 @@ +Subproject commit 6ec12891f89ec5cb6fcaef4b5162a07a0b222fca