Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
matsadler committed May 9, 2024
1 parent 6b620f8 commit 056893c
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/embed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,22 +130,21 @@ pub unsafe fn init() -> Cleanup {

#[inline(always)]
unsafe fn init_options(opts: &[&str]) {
// let mut argv = vec![CString::new("ruby").unwrap()];
// argv.extend(opts.iter().map(|s| CString::new(*s).unwrap()));
// let mut argv = argv
// .iter()
// .map(|cs| cs.as_ptr() as *mut _)
// .collect::<Vec<_>>();
// let mut node = 0 as _;
// protect(|| {
// node = ruby_process_options(argv.len() as i32, argv.as_mut_ptr());
// Ruby::get_unchecked().qnil()
// })
// .unwrap();
let mut argv = vec![CString::new("ruby").unwrap()];
argv.extend(opts.iter().map(|s| CString::new(*s).unwrap()));
let mut argv = argv
.iter()
.map(|cs| cs.as_ptr() as *mut _)
.collect::<Vec<_>>();
let mut node = 0 as _;
protect(|| {
node = ruby_process_options(argv.len() as i32, argv.as_mut_ptr());
Ruby::get_unchecked().qnil()
})
.unwrap();
// if ruby_exec_node(node) != 0 {
// panic!("Ruby init code failed");
// };
()
}

/// # Embedding
Expand Down

0 comments on commit 056893c

Please sign in to comment.