Skip to content

Commit

Permalink
Tests another allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
sanpii committed Oct 9, 2023
1 parent 5bf6744 commit c32d246
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-*')
11 changes: 10 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-*')

0 comments on commit c32d246

Please sign in to comment.