Skip to content

Commit 5fd8299

Browse files
committed
Support tcmalloc_minimal
1 parent ee1206c commit 5fd8299

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

script/get-lib-tcmalloc/meta.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ tests:
4444
- branch.master
4545
uid: bc454a366fed44f2
4646
variations:
47+
full:
48+
group: build-type
49+
default: true
50+
env:
51+
MLC_TCMALLOC_BUILD_NAME: tcmalloc
52+
minimal:
53+
group: build-type
54+
env:
55+
MLC_TCMALLOC_BUILD_NAME: tcmalloc_minimal
56+
4757
branch.#:
4858
env:
4959
MLC_GIT_CHECKOUT: '#'

script/get-lib-tcmalloc/run.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ CUR=$PWD
99
cd ${MLC_TCMALLOC_SRC_PATH}
1010

1111
# Check if "libtcmalloc.so" exists in the BUILD file
12-
if ! grep -q "libtcmalloc.so" tcmalloc/BUILD; then
12+
if ! grep -q "${MLC_TCMALLOC_BUILD_NAME}.so" tcmalloc/BUILD; then
1313
echo '
1414
cc_binary(
15-
name = "libtcmalloc.so",
15+
name = "'$MLC_TCMALLOC_BUILD_NAME'.so",
1616
deps = [":tcmalloc"],
1717
linkshared = 1,
1818
)' >> tcmalloc/BUILD
19-
echo "Added libtcmalloc.so target to tcmalloc/BUILD"
19+
echo "Added ${MLC_TCMALLOC_BUILD_NAME}.so target to tcmalloc/BUILD"
2020
else
2121
echo "libtcmalloc.so target already exists in tcmalloc/BUILD, skipping..."
2222
fi
@@ -26,7 +26,7 @@ fi
2626
COMP_MODE="opt"
2727

2828
# Build with opt
29-
bazel build -c $COMP_MODE //tcmalloc:libtcmalloc.so
29+
bazel build -c $COMP_MODE //tcmalloc:${MLC_TCMALLOC_BUILD_NAME}.so
3030

3131
# Get the path for THAT SPECIFIC mode
3232
BIN_DIR=$(bazel info -c $COMP_MODE bazel-bin)

0 commit comments

Comments
 (0)