@@ -29,17 +29,20 @@ unsafe impl GlobalAlloc for GcAllocator {
29
29
}
30
30
31
31
#[ cfg( feature = "rustgc" ) ]
32
+ #[ inline]
32
33
unsafe fn alloc_precise ( & self , layout : Layout , bitmap : usize , bitmap_size : usize ) -> * mut u8 {
33
34
let gc_descr = boehm:: GC_make_descriptor ( & bitmap, bitmap_size) ;
34
35
boehm:: GC_malloc_explicitly_typed ( layout. size ( ) , gc_descr) as * mut u8
35
36
}
36
37
37
38
#[ cfg( feature = "rustgc" ) ]
39
+ #[ inline]
38
40
fn alloc_conservative ( & self , layout : Layout ) -> * mut u8 {
39
41
unsafe { boehm:: GC_malloc ( layout. size ( ) ) as * mut u8 }
40
42
}
41
43
42
44
#[ cfg( feature = "rustgc" ) ]
45
+ #[ inline]
43
46
unsafe fn alloc_untraceable ( & self , layout : Layout ) -> * mut u8 {
44
47
boehm:: GC_malloc_atomic ( layout. size ( ) ) as * mut u8
45
48
}
@@ -57,6 +60,7 @@ unsafe impl Allocator for GcAllocator {
57
60
unsafe fn deallocate ( & self , _: NonNull < u8 > , _: Layout ) { }
58
61
59
62
#[ cfg( feature = "rustgc" ) ]
63
+ #[ inline]
60
64
fn alloc_untraceable ( & self , layout : Layout ) -> Result < NonNull < [ u8 ] > , AllocError > {
61
65
unsafe {
62
66
let ptr = boehm:: GC_malloc_atomic ( layout. size ( ) ) as * mut u8 ;
@@ -66,6 +70,7 @@ unsafe impl Allocator for GcAllocator {
66
70
}
67
71
68
72
#[ cfg( feature = "rustgc" ) ]
73
+ #[ inline]
69
74
fn alloc_conservative ( & self , layout : Layout ) -> Result < NonNull < [ u8 ] > , AllocError > {
70
75
unsafe {
71
76
let ptr = boehm:: GC_malloc ( layout. size ( ) ) as * mut u8 ;
@@ -75,6 +80,7 @@ unsafe impl Allocator for GcAllocator {
75
80
}
76
81
77
82
#[ cfg( feature = "rustgc" ) ]
83
+ #[ inline]
78
84
fn alloc_precise (
79
85
& self ,
80
86
layout : Layout ,
0 commit comments