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 1
1
extern crate libc;
2
2
3
- use defines:: AfError ;
3
+ use defines:: { AfError , DType } ;
4
4
use error:: HANDLE_ERROR ;
5
5
use self :: libc:: { c_int, size_t, c_char, c_void} ;
6
6
use std:: ffi:: CString ;
@@ -22,7 +22,8 @@ extern {
22
22
fn af_device_gc ( ) -> c_int ;
23
23
fn af_sync ( device : c_int ) -> c_int ;
24
24
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 ;
26
27
}
27
28
28
29
/// Get ArrayFire Version Number
@@ -76,7 +77,7 @@ pub fn info_string(verbose: bool) -> String {
76
77
let err_val = af_info_string ( & mut tmp, verbose) ;
77
78
HANDLE_ERROR ( AfError :: from ( err_val) ) ;
78
79
79
- let result = CString :: from_raw ( tmp) . into_string ( ) . unwrap ( ) ;
80
+ let result = ( * CString :: from_raw ( tmp) ) . to_str ( ) . unwrap ( ) . to_owned ( ) ;
80
81
81
82
let err_val = af_free_host ( tmp as * mut c_void ) ;
82
83
HANDLE_ERROR ( AfError :: from ( err_val) ) ;
You can’t perform that action at this time.
0 commit comments