Changeset - c2b16314e873
[Not reviewed]
0 6 0
Christopher Esterhuyse - 5 years ago 2020-10-28 09:37:42
christopher.esterhuyse@gmail.com
cleanup of unused code
6 files changed with 3 insertions and 32 deletions:
0 comments (0 inline, 0 general)
src/common.rs
Show inline comments
 
@@ -98,7 +98,6 @@ pub(crate) enum SyncBlocker {
 
    CouldntReadMsg(PortId),
 
    CouldntCheckFiring(PortId),
 
    PutMsg(PortId, Payload),
 
    NondetChoice { n: u16 },
 
}
 
pub(crate) struct DenseDebugHex<'a>(pub &'a [u8]);
 
pub(crate) struct DebuggableIter<I: Iterator<Item = T> + Clone, T: Debug>(pub(crate) I);
src/protocol/arena.rs
Show inline comments
 
@@ -8,7 +8,7 @@ pub struct Id<T> {
 
    _phantom: PhantomData<T>,
 
}
 
#[derive(Debug, serde::Serialize, serde::Deserialize)]
 
pub struct Arena<T> {
 
pub(crate) struct Arena<T> {
 
    store: Vec<T>,
 
}
 
//////////////////////////////////
src/protocol/eval.rs
Show inline comments
 
@@ -6,11 +6,9 @@ use std::{i16, i32, i64, i8};
 
use crate::common::*;
 

	
 
use crate::protocol::ast::*;
 
// use crate::protocol::inputsource::*;
 
// use crate::protocol::parser::*;
 
use crate::protocol::EvalContext;
 

	
 
const MAX_RECURSION: usize = 1024;
 
// const MAX_RECURSION: usize = 1024;
 

	
 
const BYTE_MIN: i64 = i8::MIN as i64;
 
const BYTE_MAX: i64 = i8::MAX as i64;
src/runtime/communication.rs
Show inline comments
 
@@ -1095,20 +1095,6 @@ impl BranchingProtoComponent {
 
                        // This branch exits the cyclic drain
 
                        Self::insert_branch_merging(cd.output, predicate, branch);
 
                    }
 
                    B::NondetChoice { n } => {
 
                        // This branch requested the creation of a new n-way nondeterministic
 
                        // fork of the branch with a fresh speculative variable.
 
                        // ... allocate a new speculative variable
 
                        let var = rctx.spec_var_stream.next();
 
                        // ... and for n distinct values, create a new forked branch,
 
                        // and schedule them to be rerun through the cyclic drain.
 
                        for val in SpecVal::iter_domain().take(n as usize) {
 
                            let predicate_n = predicate.clone().inserted(var, val);
 
                            let mut branch_n = branch.clone();
 
                            branch_n.inner.untaken_choice = Some(val.0);
 
                            Self::insert_branch_merging(cd.swap, predicate_n, branch_n);
 
                        }
 
                    }
 
                }
 
            }
 
            std::mem::swap(cd.input, cd.swap);
 
@@ -1440,14 +1426,4 @@ impl SyncProtoContext<'_> {
 
        }
 
        maybe_msg
 
    }
 

	
 
    // NOT CURRENTLY USED
 
    // Once this component has injected a new nondeterministic branch with
 
    // SyncBlocker::NondetChoice, this is how the component retrieves it.
 
    // (Two step process necessary to get around mutable access rules,
 
    //  as injection of the nondeterministic choice modifies the
 
    //  branch predicate, forks the branch, etc.)
 
    pub(crate) fn take_choice(&mut self) -> Option<u16> {
 
        self.branch_inner.untaken_choice.take()
 
    }
 
}
src/runtime/mod.rs
Show inline comments
 
@@ -70,7 +70,6 @@ pub(crate) struct SyncProtoContext<'a> {
 
// access control.
 
#[derive(Default, Debug, Clone)]
 
struct ProtoComponentBranchInner {
 
    untaken_choice: Option<u16>,
 
    did_put_or_get: HashSet<PortId>,
 
    inbox: HashMap<PortId, Payload>,
 
}
src/runtime/setup.rs
Show inline comments
 
@@ -6,7 +6,6 @@ impl TokenTarget {
 
    // [NET_ENDPOINT][UDP_ENDPOINT  ]
 
    // ^0            ^usize::MAX/2   ^usize::MAX
 
    const HALFWAY_INDEX: usize = usize::MAX / 2;
 
    const MAX_INDEX: usize = usize::MAX;
 
}
 
impl From<Token> for TokenTarget {
 
    fn from(Token(index): Token) -> Self {
 
@@ -1033,7 +1032,7 @@ fn session_optimize(
 
// and returning an optimized map.
 
fn leader_session_map_optimize(
 
    logger: &mut dyn Logger,
 
    mut m: HashMap<ConnectorId, SessionInfo>,
 
    m: HashMap<ConnectorId, SessionInfo>,
 
) -> Result<HashMap<ConnectorId, SessionInfo>, ConnectError> {
 
    log!(logger, "Session map optimize START");
 
    // currently, it's the identity function
0 comments (0 inline, 0 general)