11#![ no_std]
22#![ allow( non_camel_case_types) ]
33
4- use core:: ffi:: c_void;
5- use libc:: size_t;
4+ use { core:: ffi:: c_void, core:: usize} ;
65
76extern "C" {
87 /// Allocate the memory with the given alignment and size.
@@ -12,14 +11,14 @@ extern "C" {
1211 /// - `alignment` is greater than zero
1312 /// - `alignment` is a power of 2
1413 /// The program may be forced to abort if the constrains are not full-filled.
15- pub fn rust_alloc ( alignment : size_t , size : size_t ) -> * mut c_void ;
14+ pub fn rust_alloc ( alignment : usize , size : usize ) -> * mut c_void ;
1615
1716 /// De-allocate the memory at the given address with the given alignment and size.
1817 /// The client must assure the following things:
1918 /// - the memory is acquired using the same allocator and the pointer points to the start position.
2019 /// - `alignment` and `size` is the same as allocation
2120 /// The program may be forced to abort if the constrains are not full-filled.
22- pub fn rust_dealloc ( ptr : * mut c_void , alignment : size_t , size : size_t ) -> c_void ;
21+ pub fn rust_dealloc ( ptr : * mut c_void , alignment : usize , size : usize ) -> c_void ;
2322
2423 /// Re-allocate the memory at the given address with the given alignment and size.
2524 /// On success, it returns a pointer pointing to the required memory address.
@@ -32,9 +31,9 @@ extern "C" {
3231 /// The program may be forced to abort if the constrains are not full-filled.
3332 pub fn rust_realloc (
3433 ptr : * mut c_void ,
35- alignment : size_t ,
36- old_size : size_t ,
37- new_size : size_t ,
34+ alignment : usize ,
35+ old_size : usize ,
36+ new_size : usize ,
3837 ) -> * mut c_void ;
3938
4039 /// Allocate `count` items of `size` length each.
0 commit comments