Skip to content

Commit 574438f

Browse files
committed
Cleanup
1 parent 4009375 commit 574438f

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

src/core/haplotype.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ impl Mutant {
556556
}
557557
}
558558

559+
#[require_deferred_drop]
559560
pub fn get_base(&self, position: &usize) -> Symbol {
560561
match self.changes.get(position) {
561562
Some((_from, to)) => *to,
@@ -682,42 +683,29 @@ impl Mutant {
682683
let ancestor = self.ancestor.clone();
683684
let wildtype = self.wildtype.clone();
684685

685-
// // we need to decrement the dirty descendants of the ancestor
686-
// // because it will be decremented when the previous node gets removed
687-
// ancestor.decrement_dirty_descendants();
688-
689686
// create new node
690687
unsafe {
691688
Mutant::new_and_replace(descendant_inner, ancestor, wildtype, changes, generation);
692689
};
693690
}
694691

695692
/// Defers the drop of the haplotype if it is required
696-
// fn request_deferred_drop(&self, reference: HaplotypeRef, guard: MutexGuard<AtomicIsize>) {
697-
// dbg!("Request deferred drop.");
698-
// // dbg!(self as *const Mutant);
699-
// // dbg!(&guard);
700-
// if guard.load(Ordering::SeqCst) > 0 {
701-
// dbg!(&reference);
693+
// fn request_deferred_drop(&self, reference: HaplotypeRef, guard: &MutexGuard<usize>) {
694+
// if **guard > 0 {
702695
// self._drop.set(Some(reference));
703696
// }
704697
// }
705698

706699
/// Notifies that any drop needs to be deferred
707700
fn require_deferred_drop(&self) {
708701
let mut guard = self._defer_drop.lock().unwrap();
709-
dbg!("Requiring deferred drop.");
710-
dbg!(self as *const Mutant);
711702
*guard += 1;
712703
}
713704

714705
/// Check if a drop has been deferred and if any other thread has requested deferred drop.
715706
/// If no other thread has requested deferred drop, the drop will be executed.
716707
fn inquire_deferred_drop(&self) -> Result<Option<HaplotypeRef>> {
717708
let mut guard = self._defer_drop.lock().unwrap();
718-
dbg!("Inquiring deferred drop.");
719-
dbg!(self as *const Mutant);
720-
// dbg!(self as *const Mutant);
721709

722710
match *guard {
723711
0 => Err(VirolutionError::ImplementationError(

0 commit comments

Comments
 (0)