3
3
use core:: ffi:: c_void;
4
4
5
5
extern "C" {
6
- pub fn mi_zalloc ( size : usize ) -> * const c_void ;
7
- pub fn mi_malloc ( size : usize ) -> * const c_void ;
8
- pub fn mi_realloc ( p : * const c_void , size : usize ) -> * const c_void ;
9
- pub fn mi_zalloc_aligned ( size : usize , alignment : usize ) -> * const c_void ;
10
- pub fn mi_malloc_aligned ( size : usize , alignment : usize ) -> * const c_void ;
11
- pub fn mi_realloc_aligned ( p : * const c_void , size : usize , alignment : usize ) -> * const c_void ;
12
- pub fn mi_free ( p : * const c_void ) -> c_void ;
6
+ pub fn mi_zalloc ( size : usize ) -> * mut c_void ;
7
+ pub fn mi_malloc ( size : usize ) -> * mut c_void ;
8
+ pub fn mi_realloc ( p : * mut c_void , size : usize ) -> * mut c_void ;
9
+ pub fn mi_zalloc_aligned ( size : usize , alignment : usize ) -> * mut c_void ;
10
+ pub fn mi_malloc_aligned ( size : usize , alignment : usize ) -> * mut c_void ;
11
+ pub fn mi_realloc_aligned ( p : * mut c_void , size : usize , alignment : usize ) -> * mut c_void ;
12
+ pub fn mi_free ( p : * mut c_void ) -> c_void ;
13
13
pub fn mi_usable_size ( p : * mut c_void ) -> usize ;
14
14
}
15
15
@@ -20,20 +20,20 @@ mod tests {
20
20
#[ test]
21
21
fn it_frees_memory_malloc ( ) {
22
22
let ptr = unsafe { mi_malloc_aligned ( 8 , 8 ) } as * mut u8 ;
23
- unsafe { mi_free ( ptr as * const c_void ) } ;
23
+ unsafe { mi_free ( ptr as * mut c_void ) } ;
24
24
}
25
25
26
26
#[ test]
27
27
fn it_frees_memory_zalloc ( ) {
28
28
let ptr = unsafe { mi_zalloc_aligned ( 8 , 8 ) } as * mut u8 ;
29
- unsafe { mi_free ( ptr as * const c_void ) } ;
29
+ unsafe { mi_free ( ptr as * mut c_void ) } ;
30
30
}
31
31
32
32
#[ test]
33
33
fn it_frees_memory_realloc ( ) {
34
34
let ptr = unsafe { mi_malloc_aligned ( 8 , 8 ) } as * mut u8 ;
35
- let ptr = unsafe { mi_realloc_aligned ( ptr as * const c_void , 8 , 8 ) } as * mut u8 ;
36
- unsafe { mi_free ( ptr as * const c_void ) } ;
35
+ let ptr = unsafe { mi_realloc_aligned ( ptr as * mut c_void , 8 , 8 ) } as * mut u8 ;
36
+ unsafe { mi_free ( ptr as * mut c_void ) } ;
37
37
}
38
38
39
39
#[ test]
0 commit comments