Skip to content

Commit e99ea54

Browse files
committed
Change get_allocated_bytes return to be usize
1 parent d0c75c8 commit e99ea54

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/array.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use dim4::Dim4;
44
use defines::{AfError, DType, Backend};
55
use error::HANDLE_ERROR;
66
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};
88
use 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

Comments
 (0)