Skip to content

Commit

Permalink
Add yalloc allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
Joris van der Geer committed Nov 11, 2024
1 parent 0e56518 commit 84ca87a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ for the versions:
- **tcg**: The [_tcmalloc_](https://github.com/google/tcmalloc)
allocator, maintained and [used](https://cloud.google.com/blog/topics/systems/trading-off-malloc-costs-and-fleet-efficiency)
by Google.
- **yal**: The [_yalloc_](https://github.com/jorisgeer/yalloc) yet another allocator aims at balancing safety and compactness.
- **sys**: The system allocator. Here we usually use the _glibc_ allocator
(which is originally based on _Ptmalloc2_).

Expand Down
6 changes: 4 additions & 2 deletions bench.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
# Copyright 2018-2022, Microsoft Research, Daan Leijen, Julien Voisin, Matthew Parkinson
# Copyright 2018-2024, Microsoft Research, Daan Leijen, Julien Voisin, Matthew Parkinson


# --------------------------------------------------------------------
# Allocators and tests
# --------------------------------------------------------------------

readonly alloc_all="sys dh ff fg gd hd hm hml iso je lf lp lt mi mi-sec mi2 mi2-sec mng mesh nomesh pa rp sc scudo sg sm sn sn-sec tbb tc tcg mi-dbg mi2-dbg xmi xsmi xmi-dbg"
readonly alloc_all="sys dh ff fg gd hd hm hml iso je lf lp lt mi mi-sec mi2 mi2-sec mng mesh nomesh pa rp sc scudo sg sm sn sn-sec tbb tc tcg mi-dbg mi2-dbg xmi xsmi xmi-dbg yal"
readonly alloc_secure="dh ff gd hm hml iso mi-sec mi2-sec mng pa scudo sg sn-sec sg"
alloc_run="" # allocators to run (expanded by command line options)
alloc_installed="sys" # later expanded to include all installed allocators
Expand Down Expand Up @@ -123,6 +123,7 @@ alloc_lib_add "sn-sec" "$localdevdir/sn/release/libsnmallocshim-checks$extso"
alloc_lib_add "tbb" "$lib_tbb"
alloc_lib_add "tc" "$localdevdir/tc/.libs/libtcmalloc_minimal$extso"
alloc_lib_add "tcg" "$localdevdir/tcg/bazel-bin/tcmalloc/libtcmalloc$extso"
alloc_lib_add "yal" "$localdevdir/yal/yalloc$extso"

alloc_lib_add "mi" "$localdevdir/mi/out/release/libmimalloc$extso"
alloc_lib_add "mi-sec" "$localdevdir/mi/out/secure/libmimalloc-secure$extso"
Expand Down Expand Up @@ -414,6 +415,7 @@ while : ; do
echo " tbb use Intel TBB malloc"
echo " tc use tcmalloc (from gperftools)"
echo " tcg use tcmalloc (from Google)"
echo " yalloc use yalloc"
echo ""
echo "tests included in 'allt':"
echo " $tests_all1"
Expand Down
13 changes: 12 additions & 1 deletion build-bench-env.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2018-2022, Microsoft Research, Daan Leijen, Julien Voisin, Matthew Parkinson
# Copyright 2018-2024, Microsoft Research, Daan Leijen, Julien Voisin, Matthew Parkinson

set -eo pipefail

Expand Down Expand Up @@ -63,6 +63,7 @@ readonly version_sn=0.6.2
readonly version_tbb=v2021.9.0
readonly version_tc=gperftools-2.16
readonly version_tcg=8febb4b4da2ab3b04862a8676fb5b506ef90aa42 # 2024-07-30
readonly version_yal=main

# benchmark versions
readonly version_redis=6.2.7
Expand Down Expand Up @@ -101,6 +102,7 @@ setup_sn=0
setup_tbb=0
setup_tc=0
setup_tcg=0
setup_yal=0

# bigger benchmarks
setup_bench=0
Expand Down Expand Up @@ -142,6 +144,7 @@ while : ; do
setup_sg=$flag_arg
setup_tbb=$flag_arg
setup_tc=$flag_arg
setup_yal=$flag_arg
if [ -z "$darwin" ]; then
setup_tcg=$flag_arg # lacking 'malloc.h'
setup_dh=$flag_arg
Expand Down Expand Up @@ -230,6 +233,9 @@ while : ; do
setup_tc=$flag_arg;;
tcg)
setup_tcg=$flag_arg;;
yal)
setup_yal=$flag_arg;;

-r|--rebuild)
rebuild=1;;
-j=*|--procs=*)
Expand Down Expand Up @@ -268,6 +274,7 @@ while : ; do
echo " tbb setup Intel TBB malloc ($version_tbb)"
echo " tc setup tcmalloc ($version_tc)"
echo " tcg setup Google's tcmalloc ($version_tcg)"
echo " yal setup yalloc ($version_yal)"
echo ""
echo " bench build all local benchmarks"
echo " lean setup lean 3 benchmark"
Expand Down Expand Up @@ -741,6 +748,10 @@ if test "$setup_mi2" = "1"; then
popd
fi

if test "$setup_yal" = "1"; then
checkout yal $version_yal https://github.com/jorisgeer/yalloc
./build.sh -V
fi

phase "install benchmarks"

Expand Down

0 comments on commit 84ca87a

Please sign in to comment.