@@ -4,7 +4,7 @@ use dim4::Dim4;
44use defines:: { AfError , DType , Backend } ;
55use error:: HANDLE_ERROR ;
66use 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} ;
88use std:: ffi:: CString ;
99
1010// Some unused functions from array.h in C-API of ArrayFire
@@ -101,7 +101,7 @@ extern {
101101
102102 fn af_get_device_ptr ( ptr : MutVoidPtr , arr : AfArray ) -> c_int ;
103103
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 ;
105105}
106106
107107/// A multidimensional data container
@@ -412,10 +412,10 @@ impl Array {
412412 ///
413413 /// This function will return the size of the parent/owner if the current Array object is an
414414 /// indexed Array.
415- pub fn get_allocated_bytes ( & self ) -> u64 {
415+ pub fn get_allocated_bytes ( & self ) -> usize {
416416 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 ) ;
419419 HANDLE_ERROR ( AfError :: from ( err_val) ) ;
420420 temp
421421 }
0 commit comments