From 9abe8f6028feb1501ab7cca91aaf3825b3ea0d56 Mon Sep 17 00:00:00 2001 From: Pedro Arruda Date: Sat, 13 Jul 2024 19:47:57 -0300 Subject: [PATCH] remove debug messages --- cjyafn/src/lib.rs | 7 ------- jyafn/src/function.rs | 13 ------------- jyafn/src/graph/compile/mod.rs | 3 --- jyafn/src/mapping/mod.rs | 3 --- 4 files changed, 26 deletions(-) diff --git a/cjyafn/src/lib.rs b/cjyafn/src/lib.rs index 93dd2ac..cd2bfed 100644 --- a/cjyafn/src/lib.rs +++ b/cjyafn/src/lib.rs @@ -626,20 +626,13 @@ pub extern "C" fn function_eval_json(func: *const (), input: *mut c_char) -> Out unsafe { try_with(func, |func: &Function| { let input_cstr = CStr::from_ptr(input); - println!("input_cstr created"); let input_str = input_cstr.to_string_lossy(); - println!("input_str created"); let input_value: serde_json::Value = serde_json::from_str(input_str.trim()).map_err(|e| e.to_string())?; - println!("input_value created"); let output_value: serde_json::Value = func.eval(&input_value)?; - println!("func evaled"); let output_str = serde_json::to_string(&output_value).expect("can serialize"); - println!("output_str created"); let output_cstr = new_c_str(output_str); - println!("output_cstr created"); - println!("out:{:?}", output_cstr); Ok(output_cstr) }) } diff --git a/jyafn/src/function.rs b/jyafn/src/function.rs index ad067c2..aba7b44 100644 --- a/jyafn/src/function.rs +++ b/jyafn/src/function.rs @@ -154,8 +154,6 @@ impl Function { assert_eq!(self.data.input_size, input.len()); assert_eq!(self.data.output_size, output.len()); - println!("doing the very, very dangerous call"); - println!("calling function at {:?}", self.data.fn_ptr); // Safety: input and output sizes are checked and function pinky-promisses not to // accesses anything out of bounds. unsafe { (self.data.fn_ptr)(input.as_ptr(), output.as_mut_ptr()) } @@ -182,29 +180,23 @@ impl Function { E: ?Sized + layout::Encode, D: layout::Decoder, { - println!("starting eval wit decoder"); // Access buffers: let local_input = self .data .input .get_or(|| RefCell::new(layout::Visitor::new(self.data.input_size / 8))); - println!("local input created"); let local_output = self .data .output .get_or(|| RefCell::new(layout::Visitor::new(self.data.output_size / 8))); - println!("local output created"); let mut encode_visitor = local_input.borrow_mut(); encode_visitor.reset(); - println!("encode visitor reset"); let mut decode_visitor = local_output.borrow_mut(); decode_visitor.reset(); - println!("decode visitor reset"); // Define a symbols view (to store symbols present in the input not present in the // graph) let mut symbols_view = layout::SymbolsView::new(&self.data.graph.symbols); - println!("symbols view created"); // Serialization dance: input @@ -214,22 +206,17 @@ impl Function { &mut encode_visitor, ) .map_err(|err| Error::EncodeError(Box::new(err)))?; - println!("serialization dance done... time for the big surprise"); // Call: let status = self.call_raw(&encode_visitor.0, &mut decode_visitor.0); - println!("called raw"); if status != std::ptr::null() { - println!("status is not null"); // Safety: null was checked and the function pinky-promisses to return a valid // C string in case of error. let error = unsafe { CStr::from_ptr(status) }; - println!("raising status"); return Err(Error::StatusRaised(error.to_string_lossy().to_string())); } // Deserialization dance: - println!("doing decoder dance"); Ok(decoder.build(&self.data.output_layout, &symbols_view, &mut decode_visitor)) } diff --git a/jyafn/src/graph/compile/mod.rs b/jyafn/src/graph/compile/mod.rs index 909f0ad..9dc03af 100644 --- a/jyafn/src/graph/compile/mod.rs +++ b/jyafn/src/graph/compile/mod.rs @@ -173,9 +173,6 @@ where }); } - println!("{rendered}"); - println!("{}", String::from_utf8_lossy(&qbe_output.stdout)); - Ok(String::from_utf8_lossy(&qbe_output.stdout).to_string()) } diff --git a/jyafn/src/mapping/mod.rs b/jyafn/src/mapping/mod.rs index 2d5b945..1538a48 100644 --- a/jyafn/src/mapping/mod.rs +++ b/jyafn/src/mapping/mod.rs @@ -215,13 +215,10 @@ impl Mapping { } unsafe fn call_mapping(mapping: *const Mapping, hash: u64) -> *const u8 { - println!("calling mapping at {:?}", mapping); let mapping = &*mapping; if let Some(line) = mapping.storage.as_ref().and_then(|s| s.get(hash)) { - println!("found line at {:?}", line.as_ptr()); line.as_ptr() } else { - println!("line not found"); std::ptr::null() } }