mirror of
https://github.com/bdwgc/bdwgc-rust.git
synced 2026-10-25 09:23:18 -06:00
177e1a7e01a812cc7c94c2f51464f55b2bf188d0
2547e33 to e50d792 (#589)
Bumps [bdwgc-alloc-sys/vendor/bdwgc](https://github.com/bdwgc/bdwgc) from `2547e33` to `e50d792`. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/bdwgc/bdwgc/commit/e50d792d8abfcd5092eb16113ffb618e913c890b"><code>e50d792</code></a> Handle userfaultfd protection ranges crossing VMAs</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/ff0e10325794de755f242fddb11aaed6c64958a8"><code>ff0e103</code></a> Let the userfaultfd monitor sleep while idle</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/cbfd19034adc5252e92d8dd5788a4677ac4689df"><code>cbfd190</code></a> Support mprotect-based incremental mode on E2K (single-threaded collector)</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/bb2c910041f3b98e04faf481a6ed9c46fccecd99"><code>bb2c910</code></a> Travis CI: Update autotools for tarball release (ac-2.73, am-1.19, lt-2.6.2)</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/24f27e6c1ed16a812ae9fe0bbcd615056ca71b43"><code>24f27e6</code></a> GH Actions: Eliminate 'error=dev option is deprecated' cmake warning</li> <li>See full diff in <a href="https://github.com/bdwgc/bdwgc/compare/2547e33aa8123320dd8021ca3cea998075ede415...e50d792d8abfcd5092eb16113ffb618e913c890b">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%