remove instrumentation

This commit is contained in:
Folkert 2022-03-17 19:48:35 +01:00
parent 0d28b5f475
commit be07cbe49d
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 1 additions and 87 deletions

View file

@ -2039,12 +2039,6 @@ fn finish_specialization(
subs: Subs, subs: Subs,
exposed_to_host: ExposedToHost, exposed_to_host: ExposedToHost,
) -> Result<MonomorphizedModule, LoadingProblem> { ) -> Result<MonomorphizedModule, LoadingProblem> {
if false {
println!(
"total Type clones: {} ",
roc_types::types::get_type_clone_count()
);
}
let module_ids = Arc::try_unwrap(state.arc_modules) let module_ids = Arc::try_unwrap(state.arc_modules)
.unwrap_or_else(|_| panic!("There were still outstanding Arc references to module_ids")) .unwrap_or_else(|_| panic!("There were still outstanding Arc references to module_ids"))
.into_inner() .into_inner()

View file

@ -176,7 +176,7 @@ impl LambdaSet {
} }
} }
#[derive(PartialEq, Eq)] #[derive(PartialEq, Eq, Clone)]
pub enum Type { pub enum Type {
EmptyRec, EmptyRec,
EmptyTagUnion, EmptyTagUnion,
@ -237,19 +237,6 @@ impl TypeExtension {
} }
} }
impl IntoIterator for TypeExtension {
type Item = Box<Type>;
type IntoIter = std::option::IntoIter<Self::Item>;
fn into_iter(self) -> Self::IntoIter {
match self {
TypeExtension::Open(ext) => Some(ext).into_iter(),
TypeExtension::Closed => None.into_iter(),
}
}
}
impl<'a> IntoIterator for &'a TypeExtension { impl<'a> IntoIterator for &'a TypeExtension {
type Item = &'a Type; type Item = &'a Type;
@ -263,73 +250,6 @@ impl<'a> IntoIterator for &'a TypeExtension {
} }
} }
static mut TYPE_CLONE_COUNT: std::sync::atomic::AtomicUsize =
std::sync::atomic::AtomicUsize::new(0);
pub fn get_type_clone_count() -> usize {
unsafe { TYPE_CLONE_COUNT.load(std::sync::atomic::Ordering::SeqCst) }
}
impl Clone for Type {
fn clone(&self) -> Self {
match self {
Self::EmptyRec => {
unsafe { TYPE_CLONE_COUNT.fetch_add(1, std::sync::atomic::Ordering::SeqCst) };
Self::EmptyRec
}
Self::EmptyTagUnion => {
unsafe { TYPE_CLONE_COUNT.fetch_add(1, std::sync::atomic::Ordering::SeqCst) };
Self::EmptyTagUnion
}
Self::Function(arg0, arg1, arg2) => {
Self::Function(arg0.clone(), arg1.clone(), arg2.clone())
}
Self::Record(arg0, arg1) => Self::Record(arg0.clone(), arg1.clone()),
Self::TagUnion(arg0, arg1) => Self::TagUnion(arg0.clone(), arg1.clone()),
Self::FunctionOrTagUnion(arg0, arg1, arg2) => {
Self::FunctionOrTagUnion(arg0.clone(), arg1.clone(), arg2.clone())
}
Self::ClosureTag { name, ext } => Self::ClosureTag {
name: name.clone(),
ext: ext.clone(),
},
Self::Alias {
symbol,
type_arguments,
lambda_set_variables,
actual,
kind,
} => Self::Alias {
symbol: symbol.clone(),
type_arguments: type_arguments.clone(),
lambda_set_variables: lambda_set_variables.clone(),
actual: actual.clone(),
kind: kind.clone(),
},
Self::HostExposedAlias {
name,
type_arguments,
lambda_set_variables,
actual_var,
actual,
} => Self::HostExposedAlias {
name: name.clone(),
type_arguments: type_arguments.clone(),
lambda_set_variables: lambda_set_variables.clone(),
actual_var: actual_var.clone(),
actual: actual.clone(),
},
Self::RecursiveTagUnion(arg0, arg1, arg2) => {
Self::RecursiveTagUnion(arg0.clone(), arg1.clone(), arg2.clone())
}
Self::Apply(arg0, arg1, arg2) => Self::Apply(arg0.clone(), arg1.clone(), arg2.clone()),
Self::Variable(arg0) => Self::Variable(arg0.clone()),
Self::RangedNumber(arg0, arg1) => Self::RangedNumber(arg0.clone(), arg1.clone()),
Self::Erroneous(arg0) => Self::Erroneous(arg0.clone()),
}
}
}
impl fmt::Debug for Type { impl fmt::Debug for Type {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self { match self {