@@ -27,7 +27,7 @@ pub unsafe trait UsmAlloc : Allocator {}
2727unsafe impl < ' a , T : UsmAllocatorKind > UsmAlloc for UsmAllocator < ' a , T > { }
2828
2929pub trait UsmAllocatorKind {
30- unsafe fn alloc ( alignment : usize , bytes : usize , queue : & Queue ) -> CxxResult < * mut u8 > ;
30+ unsafe fn alloc ( alignment : usize , num_bytes : usize , queue : & Queue ) -> CxxResult < * mut u8 > ;
3131}
3232
3333impl < ' a , T : UsmAllocatorKind > From < & ' a Queue > for UsmAllocator < ' a , T > {
@@ -61,25 +61,25 @@ unsafe impl<T: UsmAllocatorKind> Allocator for UsmAllocator<'_, T> {
6161pub ( crate ) struct DeviceAllocator ;
6262
6363impl UsmAllocatorKind for DeviceAllocator {
64- unsafe fn alloc ( alignment : usize , bytes : usize , queue : & Queue ) -> CxxResult < * mut u8 > {
65- unsafe { ffi:: aligned_alloc_device ( alignment, bytes , & queue. 0 ) }
64+ unsafe fn alloc ( alignment : usize , num_bytes : usize , queue : & Queue ) -> CxxResult < * mut u8 > {
65+ unsafe { ffi:: aligned_alloc_device ( alignment, num_bytes , & queue. 0 ) }
6666 }
6767}
6868
6969/// An allocator for Host-side buffers
7070pub struct HostAllocator ;
7171
7272impl UsmAllocatorKind for HostAllocator {
73- unsafe fn alloc ( alignment : usize , bytes : usize , queue : & Queue ) -> CxxResult < * mut u8 > {
74- unsafe { ffi:: aligned_alloc_host ( alignment, bytes , & queue. 0 ) }
73+ unsafe fn alloc ( alignment : usize , num_bytes : usize , queue : & Queue ) -> CxxResult < * mut u8 > {
74+ unsafe { ffi:: aligned_alloc_host ( alignment, num_bytes , & queue. 0 ) }
7575 }
7676}
7777
7878/// An allocator for shared memory buffers
7979pub struct SharedAllocator ;
8080
8181impl UsmAllocatorKind for SharedAllocator {
82- unsafe fn alloc ( alignment : usize , bytes : usize , queue : & Queue ) -> CxxResult < * mut u8 > {
83- unsafe { ffi:: aligned_alloc_shared ( alignment, bytes , & queue. 0 ) }
82+ unsafe fn alloc ( alignment : usize , num_bytes : usize , queue : & Queue ) -> CxxResult < * mut u8 > {
83+ unsafe { ffi:: aligned_alloc_shared ( alignment, num_bytes , & queue. 0 ) }
8484 }
8585}
0 commit comments