-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace
backtrace
crate with stabilized std::backtrace
implementa…
…tion (#186) * Replace `backtrace` crate with stabilized `std::backtrace` implementation Rust 1.65 [stabilized `std::backtrace::Backtrace`], which we can use in place of the `backtrace` crate to reduce our dependency stack. Normally `Backtrace::capture()` would listen to the `RUST_BACKTRACE` and `RUST_LIB_BACKTRACE` environment variables, but this is unsuitable for us as capturing backtraces is configured via boolean debug feature flags in the `AllocatorDebugSettings` struct. Fortunately `Backtrace::force_capture()` exists which circumvents these env var checks and always returns a backtrace, and is hence used in the codebase here. Unfortuantely the type no longer implements `Clone` like `backtrace::Backtrace`, requiring us to wrap it in an `Arc` (because most of our types are thread-safe) to clone the `Backtrace` around various (sub)allocations and statistics reports. [stabilized `std::backtrace::Backtrace`]: https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html#stabilized-apis * Test MSRV in CI * Bump edition to 2021 to match MSRV 1.65
- Loading branch information
Showing
12 changed files
with
90 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,21 @@ jobs: | |
- name: Cargo check | ||
run: cargo check --workspace --all-targets --features ${{ matrix.features }} --no-default-features | ||
|
||
check_msrv: | ||
name: Check MSRV (1.65.0) | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
features: vulkan | ||
- os: windows-latest | ||
features: vulkan,d3d12 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/[email protected] | ||
- run: cargo check --workspace --all-targets --features ${{ matrix.features }} --no-default-features | ||
|
||
test: | ||
name: Test Suite | ||
strategy: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,15 @@ | |
name = "gpu-allocator" | ||
version = "0.24.0" | ||
authors = ["Traverse Research <[email protected]>"] | ||
edition = "2018" | ||
edition = "2021" | ||
license = "MIT OR Apache-2.0" | ||
description = "Memory allocator for GPU memory in Vulkan and DirectX 12" | ||
categories = ["rendering", "rendering::graphics-api"] | ||
homepage = "https://github.com/Traverse-Research/gpu-allocator" | ||
repository = "https://github.com/Traverse-Research/gpu-allocator" | ||
keywords = ["vulkan", "memory", "allocator"] | ||
documentation = "https://docs.rs/gpu-allocator/" | ||
rust-version = "1.65" | ||
|
||
include = [ | ||
"/README.md", | ||
|
@@ -19,7 +20,6 @@ include = [ | |
] | ||
|
||
[dependencies] | ||
backtrace = "0.3" | ||
log = "0.4" | ||
thiserror = "1.0" | ||
presser = { version = "0.3" } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.