File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11extern crate libc;
22
3- use defines:: AfError ;
3+ use defines:: { AfError , DType } ;
44use error:: HANDLE_ERROR ;
55use self :: libc:: { c_int, size_t, c_char, c_void} ;
66use std:: ffi:: CString ;
@@ -22,7 +22,8 @@ extern {
2222 fn af_device_gc ( ) -> c_int ;
2323 fn af_sync ( device : c_int ) -> c_int ;
2424
25- fn af_free_host ( ptr : * mut c_void ) -> c_int ;
25+ fn af_alloc_host ( elements : size_t , _type : DType ) -> * mut c_void ;
26+ fn af_free_host ( ptr : * mut c_void ) -> c_int ;
2627}
2728
2829/// Get ArrayFire Version Number
@@ -76,7 +77,7 @@ pub fn info_string(verbose: bool) -> String {
7677 let err_val = af_info_string ( & mut tmp, verbose) ;
7778 HANDLE_ERROR ( AfError :: from ( err_val) ) ;
7879
79- let result = CString :: from_raw ( tmp) . into_string ( ) . unwrap ( ) ;
80+ let result = ( * CString :: from_raw ( tmp) ) . to_str ( ) . unwrap ( ) . to_owned ( ) ;
8081
8182 let err_val = af_free_host ( tmp as * mut c_void ) ;
8283 HANDLE_ERROR ( AfError :: from ( err_val) ) ;
You can’t perform that action at this time.
0 commit comments