pub unsafe fn register_output(&mut self, pointer: *const c_void, size: usize, merger: usize) {
        let v = into_vec(pointer as *const u8, size);
        assert_eq!(size, mem::size_of::<isize>());
        debug!("Registering pointer {:?} of size {} as output variable", pointer, size);
        trace!("Output buffer: {:?}", v);

        let mut id = None;
        for (arg_id, argument) in self.arguments.iter() {
            if *argument == v {
                id = Some(*arg_id);
                break;
            }
        }

        if id.is_none() {
            // We didn't find the argument in the arguments registry. Add it in.
            let new_id = self.id_gen.next();
            self.arguments.insert(new_id, v);
            id = Some(new_id);
        }
        let id = id.unwrap();
        self.outputs.insert(id, (pointer as intptr_t, merger));
    }
/// Registers a value as a temporary. The passed value should generally be a pointer, but could
/// also be an immutable struct that has pointers inside it.
Registers a value as a temporary. The passed value should generally be a pointer, but could
also be an immutable struct that has pointers inside it.
Registers a value as a temporary . The passed value should generally be a pointer but could also be an immutable struct that has pointers inside it .
pub unsafe fn register_output(&mut self, pointer: *const c_void, size: usize, merger: usize) {
        let v = into_vec(pointer as *const u8, size);
        assert_eq!(size, mem::size_of::<isize>());
        debug!("Registering pointer {:?} of size {} as output variable", pointer, size);
        trace!("Output buffer: {:?}", v);
        let mut id = None;
        for (arg_id, argument) in self.arguments.iter() {
            if *argument == v {
                id = Some(*arg_id);
                break;
            }
        }
        if id.is_none() {
            // We didn't find the argument in the arguments registry. Add it in.
            let new_id = self.id_gen.next();
            self.arguments.insert(new_id, v);
            id = Some(new_id);
        }
        let id = id.unwrap();
        self.outputs.insert(id, (pointer as intptr_t, merger));
    }
pub unsafe fn register_output ( & mut self , pointer : * const c_void , size : usize , merger : usize ) { let v = into_vec ( pointer as * const u8 , size ) ; assert_eq ! ( size mem size_of isize ( ) ) ; debug ! ( " " pointer size ) ; trace ! ( " " v ) ; let mut id = None ; for ( arg_id , argument ) in self . arguments . iter ( ) { if * argument == v { id = Some ( * arg_id ) ; break ; } } if id . is_none ( ) { // We didn't find the argument in the arguments registry. Add it in. let new_id = self . id_gen . next ( ) ; self . arguments . insert ( new_id , v ) ; id = Some ( new_id ) ; } let id = id . unwrap ( ) ; self . outputs . insert ( id , ( pointer as intptr_t , merger ) ) ; }
Registers a value as a temporary.
Registers a value as a temporary .
&mut self
pointer
*const c_void
size
usize
merger
usize