@@ -4,7 +4,7 @@ use dim4::Dim4;
4
4
use defines:: { AfError , DType , Backend } ;
5
5
use error:: HANDLE_ERROR ;
6
6
use util:: { AfArray , DimT , HasAfEnum , MutAfArray , MutVoidPtr } ;
7
- use self :: libc:: { uint8_t, c_void, c_int, c_uint, c_longlong, c_ulong , c_char} ;
7
+ use self :: libc:: { uint8_t, c_void, c_int, c_uint, c_longlong, c_char} ;
8
8
use std:: ffi:: CString ;
9
9
10
10
// Some unused functions from array.h in C-API of ArrayFire
@@ -101,7 +101,7 @@ extern {
101
101
102
102
fn af_get_device_ptr ( ptr : MutVoidPtr , arr : AfArray ) -> c_int ;
103
103
104
- fn af_get_allocated_bytes ( result : * mut c_ulong , arr : AfArray ) -> c_int ;
104
+ fn af_get_allocated_bytes ( result : * mut usize , arr : AfArray ) -> c_int ;
105
105
}
106
106
107
107
/// A multidimensional data container
@@ -412,10 +412,10 @@ impl Array {
412
412
///
413
413
/// This function will return the size of the parent/owner if the current Array object is an
414
414
/// indexed Array.
415
- pub fn get_allocated_bytes ( & self ) -> u64 {
415
+ pub fn get_allocated_bytes ( & self ) -> usize {
416
416
unsafe {
417
- let mut temp: u64 = 0 ;
418
- let err_val = af_get_allocated_bytes ( & mut temp as * mut c_ulong , self . handle as AfArray ) ;
417
+ let mut temp: usize = 0 ;
418
+ let err_val = af_get_allocated_bytes ( & mut temp as * mut usize , self . handle as AfArray ) ;
419
419
HANDLE_ERROR ( AfError :: from ( err_val) ) ;
420
420
temp
421
421
}
0 commit comments