-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support #![no_std] for the zerogc API
An implementation doesn't nessicarrily require the stdlib or even a system allocator. However as a matter of practice, "zerogc-simple" currently requires both.
- Loading branch information
Showing
7 changed files
with
106 additions
and
77 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//! Implementations for types in the standard `alloc` crate | ||
//! | ||
//! These can be used in `#![no_std]` crates without requiring | ||
//! the entire standard library. | ||
use alloc::rc::Rc; | ||
use alloc::sync::Arc; | ||
use alloc::vec::Vec; | ||
use alloc::boxed::Box; | ||
|
||
use crate::prelude::*; | ||
|
||
// NOTE: Delegate to slice to avoid code duplication | ||
unsafe_trace_deref!(Vec, target = { [T] }; T); | ||
unsafe_trace_deref!(Box, target = T); | ||
// We can only trace `Rc` and `Arc` if the inner type implements `TraceImmutable` | ||
unsafe_trace_deref!(Rc, T; immut = required; |rc| &**rc); | ||
unsafe_trace_deref!(Arc, T; immut = required; |arc| &**arc); |
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