mirror of
https://github.com/bdwgc/bdwgc-rust.git
synced 2026-10-25 09:23:18 -06:00
702bfec75ae3ccc0409248e81bc8d685769695c5
635112b to 86bd7c0 (#591)
Bumps [bdwgc-alloc-sys/vendor/bdwgc](https://github.com/bdwgc/bdwgc) from `635112b` to `86bd7c0`. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/bdwgc/bdwgc/commit/86bd7c0a5a8b6d4ef9021d27c3a1db6ecd75499c"><code>86bd7c0</code></a> GH Actions: Increase timeout for zig-build to 10 minutes</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/f763b48daba5cb6f24849d831ed70e28ff4dc546"><code>f763b48</code></a> GH Actions: Test with -D EMULATE_PTHREAD_SEMAPHORE</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/4ee0c5a7c3f4691ac578ec1590c07fae677a20a2"><code>4ee0c5a</code></a> Allow to define EMULATE_PTHREAD_SEMAPHORE even if semaphore.h exists</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/b44373fa032f209c810ea1171455bb218d7e419a"><code>b44373f</code></a> Check sem_getvalue() result</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/1c919670a0c99742e3b4f56e666e650d35180562"><code>1c91967</code></a> GH Actions: Mention csky-linux-gnueabi[hf] targets in zig-cross-compile</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/779710e2fd93fbc39c5b8a5a91770f468cc61c17"><code>779710e</code></a> Add experimental support of Linux/csky target</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/3c1a166fb1bc06067d724bdccb257c69f1bd93c8"><code>3c1a166</code></a> Eliminate 'len may be used uninitialized' gcc warning in CORD_from_file</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/76a446bbe0ed73acfafeeab372320529600b5c56"><code>76a446b</code></a> GH Actions: Add workflow to build Linux non-arm64/x86 targets</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/cbfa8a27c4fc35da5f543ac46c2717247615a46f"><code>cbfa8a2</code></a> Add cmake-qemu and cmake-webassembly badges to README</li> <li><a href="https://github.com/bdwgc/bdwgc/commit/759cd350bb5ffb092134512b19acff09b026d207"><code>759cd35</code></a> GH Actions: Test cmake-based build using Ninja</li> <li>Additional commits viewable in <a href="https://github.com/bdwgc/bdwgc/compare/635112baf95fe862e379ed4b77e06db72472ea2f...86bd7c0a5a8b6d4ef9021d27c3a1db6ecd75499c">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%