@@ -14,14 +14,14 @@ unsafe impl GlobalAlloc for KernelAllocator {
14
14
unsafe fn alloc ( & self , layout : Layout ) -> * mut u8 {
15
15
// `krealloc()` is used instead of `kmalloc()` because the latter is
16
16
// an inline function and cannot be bound to as a result.
17
- // SAFETY: FFI call to krealloc .
17
+ // SAFETY: FFI call.
18
18
unsafe { bindings:: krealloc ( ptr:: null ( ) , layout. size ( ) , bindings:: GFP_KERNEL ) as * mut u8 }
19
19
}
20
20
21
21
unsafe fn dealloc ( & self , ptr : * mut u8 , _layout : Layout ) {
22
22
// SAFETY: the caller must guarantee that `ptr` and `layout` denote memory
23
23
// allocated by this allocator, so allocated with `kmalloc`.
24
- // FFI call to kfree
24
+ // FFI call.
25
25
unsafe {
26
26
bindings:: kfree ( ptr as * const c_types:: c_void ) ;
27
27
}
@@ -36,21 +36,21 @@ static ALLOCATOR: KernelAllocator = KernelAllocator;
36
36
// let's generate them ourselves instead.
37
37
#[ no_mangle]
38
38
pub fn __rust_alloc ( size : usize , _align : usize ) -> * mut u8 {
39
- // SAFETY: FFI call to krealloc .
39
+ // SAFETY: FFI call.
40
40
unsafe { bindings:: krealloc ( core:: ptr:: null ( ) , size, bindings:: GFP_KERNEL ) as * mut u8 }
41
41
}
42
42
43
43
#[ no_mangle]
44
44
pub fn __rust_dealloc ( ptr : * mut u8 , _size : usize , _align : usize ) {
45
45
// SAFETY: the caller must guarantee that `ptr` and `layout` denote memory
46
46
// allocated by this allocator, so allocated with `kmalloc`.
47
- // FFI call to kfree
47
+ // FFI call.
48
48
unsafe { bindings:: kfree ( ptr as * const c_types:: c_void ) } ;
49
49
}
50
50
51
51
#[ no_mangle]
52
52
pub fn __rust_realloc ( ptr : * mut u8 , _old_size : usize , _align : usize , new_size : usize ) -> * mut u8 {
53
- // SAFETY: FFI call to krealloc .
53
+ // SAFETY: FFI call.
54
54
unsafe {
55
55
bindings:: krealloc (
56
56
ptr as * const c_types:: c_void ,
@@ -62,7 +62,7 @@ pub fn __rust_realloc(ptr: *mut u8, _old_size: usize, _align: usize, new_size: u
62
62
63
63
#[ no_mangle]
64
64
pub fn __rust_alloc_zeroed ( size : usize , _align : usize ) -> * mut u8 {
65
- // SAFETY: FFI call to krealloc .
65
+ // SAFETY: FFI call.
66
66
unsafe {
67
67
bindings:: krealloc (
68
68
core:: ptr:: null ( ) ,
0 commit comments