Skip to content

Commit

Permalink
feat: add no_std once primitive for stdlib deserialization (#1463)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergerad authored Sep 6, 2024
1 parent 1b4609e commit 0ce2fe5
Show file tree
Hide file tree
Showing 7 changed files with 522 additions and 315 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

- [BREAKING] Wrapped `MastForest`s in `Program` and `Library` structs in `Arc` (#1465).
- `MastForestBuilder`: use `MastNodeId` instead of MAST root to uniquely identify procedures (#1473)
- Added `miden_core::utils::sync::racy_lock` module (#1463).
- Updated `miden_core::utils` to re-export `std::sync::LazyLock` and `racy_lock::RacyLock as LazyLock` for std and no_std environments, respectively (#1463).

#### Fixes

Expand Down
4 changes: 4 additions & 0 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ This crate contains core components used by Miden VM. These components include:

## License
This project is [MIT licensed](../LICENSE).

## Acknowledgements

The `racy_lock` module found under `core/src/utils/sync` is based on the [once_cell](https://crates.io/crates/once_cell) crate's implementation of `race::OnceBox`.
313 changes: 0 additions & 313 deletions core/src/utils/sync.rs

This file was deleted.

12 changes: 12 additions & 0 deletions core/src/utils/sync/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pub mod racy_lock;
pub mod rw_lock;

#[cfg(feature = "std")]
pub use std::sync::LazyLock;

#[cfg(feature = "std")]
pub use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard};
#[cfg(not(feature = "std"))]
pub use racy_lock::RacyLock as LazyLock;
#[cfg(not(feature = "std"))]
pub use rw_lock::{RwLock, RwLockReadGuard, RwLockWriteGuard};
Loading

0 comments on commit 0ce2fe5

Please sign in to comment.