mirror of
https://github.com/bdwgc/bdwgc-rust.git
synced 2026-10-25 09:23:18 -06:00
69b7d3d85f768e76cda24e0c649b38f01ede8e0b
e50d792 to 635112b (#590)
Bumps [bdwgc-alloc-sys/vendor/bdwgc](https://github.com/bdwgc/bdwgc) from `e50d792` to `635112b`. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/bdwgc/bdwgc/commit/635112baf95fe862e379ed4b77e06db72472ea2f"><code>635112b</code></a> GH Actions: Update to Zig 0.17</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/c8f0b365f5f8cc7a6f2c43943e361857bc2ab632"><code>c8f0b36</code></a> Fix 'no type named ptrdiff_t in namespace std' clang++ error on WASI</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/5b7c55399daa5e950c1e2fcaf85a227ef3fb807e"><code>5b7c553</code></a> Update Zig build script to Zig 0.17</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/c32067d03ac77759f0607e18f858f721d92fcc54"><code>c32067d</code></a> Eliminate 'finalizer_called set but not used' clang warning in dbgfunctest</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/638addec0e5f341be2b74fec5f2a2c771b5bce7e"><code>638adde</code></a> GH Actions: Remove 'enable_' prefix for matrix parameters</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/d20145348e4fa365ae624b3ebd581e05cda1af4e"><code>d201453</code></a> GH Actions: Do not use '>-' where not needed</li> <li>See full diff in <a href="https://github.com/bdwgc/bdwgc/compare/e50d792d8abfcd5092eb16113ffb618e913c890b...635112baf95fe862e379ed4b77e06db72472ea2f">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
bdwgc-rust
GlobalAlloc implementation for bdwgc, the conservative garbage collector.
This crate is for use cases in which developers need to integrate bdwgc into their programs written in Rust (e.g. writing a runtime library in Rust for their own programming language whose GC is done by bdwgc.)
The raw bindings to the C API of bdwgc that this crate is built on are available as the bdwgc-alloc-sys crate.
Usage
use bdwgc_alloc::Allocator;
use std::thread::spawn;
#[global_allocator]
static GLOBAL_ALLOCATOR: Allocator = Allocator;
fn main() {
unsafe { Allocator::initialize() }
// Unreachable objects are collected automatically.
Box::leak(Box::new([0u8; 256]));
// Threads other than a main thread must be registered to a collector before allocation.
spawn(|| {
unsafe { Allocator::register_current_thread() }.unwrap();
Box::leak(Box::new([0u8; 256]));
unsafe { Allocator::unregister_current_thread() }
})
.join()
.unwrap();
}
By default bdwgc is built with autotools. To build with cmake, enable the cmake feature:
cargo build --no-default-features --features cmake
License
Languages
Rust
100%