Skip to content

Commit d4c3dfa

Browse files
committed
refactor(cell): make SafeDeleter public
1 parent bbbded8 commit d4c3dfa

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/cell/cell_impl/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,13 +566,16 @@ fn hash_index(descriptor: CellDescriptor, level: u8) -> u8 {
566566

567567
// === Linear deleter ===
568568

569-
struct SafeDeleter {
569+
/// Linear deleter for cell trees.
570+
pub struct SafeDeleter {
571+
// TODO: Drop too large vector after competion?
570572
to_delete: std::cell::RefCell<Vec<CellInner>>,
571573
is_active: std::cell::Cell<bool>,
572574
}
573575

574576
impl SafeDeleter {
575-
fn retire(value: CellInner) {
577+
/// Add cell into thread-local deleter queue.
578+
pub fn retire(value: CellInner) {
576579
thread_local! {
577580
static DELETER: SafeDeleter = const {
578581
SafeDeleter {

src/cell/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub use self::cell_context::{CellContext, CellParts, LoadMode};
1313
pub use self::cell_impl::rc::{Cell, CellInner, WeakCell};
1414
#[cfg(feature = "sync")]
1515
pub use self::cell_impl::sync::{Cell, CellInner, WeakCell};
16-
pub use self::cell_impl::{StaticCell, VirtualCellWrapper};
16+
pub use self::cell_impl::{SafeDeleter, StaticCell, VirtualCellWrapper};
1717
pub use self::lazy::{Lazy, LazyExotic};
1818
pub use self::slice::{
1919
CellSlice, CellSliceParts, CellSliceRange, DisplayCellSliceData, ExactSize, Load, LoadCell,

0 commit comments

Comments
 (0)