From c32d246ceeb5dc4f0669b33c7dd935c72b27f151 Mon Sep 17 00:00:00 2001 From: Sanpi Date: Mon, 9 Oct 2023 08:05:24 +0200 Subject: [PATCH] Tests another allocator --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ .gitlab-ci.yml | 11 ++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5c4636..e801b74 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -118,3 +118,27 @@ jobs: run: cargo test --no-run --features v14 - name: valgrind run: valgrind --leak-check=full --error-exitcode=1 $(find target/debug/deps -executable -type f -name 'libpq-*') + + jemallocator: + name: Allocation check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + + - name: Install postgreSQL (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y libpq-dev postgresql valgrind + sudo service postgresql start && sleep 3 + sudo -u postgres psql --command "ALTER USER postgres PASSWORD 'root';" + + - name: Adds jemallocator + run: | + cargo add tikv-jemallocator + echo '#[global_allocator] static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;' > src/lib.rs + - name: build + run: cargo test --no-run --features v14 + - name: valgrind + run: valgrind --leak-check=full --error-exitcode=1 $(find target/debug/deps -executable -type f -name 'libpq-*') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 454df17..28aa09b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,8 +57,17 @@ test: valgrind: <<: *pg variables: - MODE: debug PG: "14" script: - cargo test --no-run --features "v$PG" - valgrind --leak-check=full --error-exitcode=1 $(find target/debug/deps -executable -type f -name 'libpq-*') + +jemallocator: + <<: *pg + variables: + PG: "14" + script: + - cargo add tikv-jemallocator + - echo '#[global_allocator] static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;' > src/lib.rs + - cargo test --no-run --features "v$PG" + - valgrind --leak-check=full --error-exitcode=1 $(find target/debug/deps -executable -type f -name 'libpq-*')