diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 87765f68541..e57b03c941f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -67,7 +67,7 @@ jobs: rustup default stable rustup component add rustfmt - name: Setup parquet files - run: | + run: | apt update && apt install python3-pip python3-venv -y -q python3 -m venv venv venv/bin/pip install pip --upgrade @@ -158,13 +158,42 @@ jobs: - name: Run env: RUST_BACKTRACE: full - RUST_LOG: 'trace' + RUST_LOG: "trace" # --skip io: miri can't handle opening of files, so we skip those run: | cargo miri setup cargo clean cargo miri test --features full -- --skip io::parquet --skip io::ipc + miri-checks-custom-allocator: + name: MIRI with custom allocator + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-miri-${{ hashFiles('**/Cargo.lock') }} + - name: Setup toolchain + run: | + rustup toolchain install nightly-2021-07-03 + rustup default nightly-2021-07-03 + rustup component add rustfmt miri + - name: Run + env: + RUST_BACKTRACE: full + RUST_LOG: "trace" + # --skip io: miri can't handle opening of files, so we skip those + run: | + cargo miri setup + cargo clean + cargo miri test --features full,cache_aligned -- --skip io::parquet --skip io::ipc + coverage: name: Coverage runs-on: ubuntu-latest @@ -185,7 +214,7 @@ jobs: # this key is not equal because coverage uses different compilation flags. key: ${{ runner.os }}-amd64-target-coverage-cache-stable- - name: Setup parquet files - run: | + run: | apt update && apt install python3-pip python3-venv -y -q python3 -m venv venv venv/bin/pip install pip --upgrade @@ -199,6 +228,7 @@ jobs: # 2020-11-15: There is a cargo-tarpaulin regression in 0.17.0 # see https://github.com/xd009642/tarpaulin/issues/618 cargo install --version 0.16.0 cargo-tarpaulin + cargo tarpaulin --features cache_aligned --out Xml cargo tarpaulin --features full --out Xml - name: Report coverage continue-on-error: true diff --git a/Cargo.toml b/Cargo.toml index 6d5684dda3d..001bcc67910 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -99,6 +99,7 @@ full = [ "compute", # parses timezones used in timestamp conversions "chrono-tz", + "cache_aligned" ] merge_sort = ["itertools"] io_csv = ["io_csv_read", "io_csv_write"] diff --git a/src/vec.rs b/src/vec.rs index 8ce7e7c785a..859769b34c0 100644 --- a/src/vec.rs +++ b/src/vec.rs @@ -45,6 +45,12 @@ pub struct AlignedVec { capacity: usize, } +impl Drop for AlignedVec { + fn drop(&mut self) { + unsafe { alloc::free_aligned(self.ptr, self.capacity) } + } +} + impl AlignedVec { #[inline] pub fn new() -> Self {