@@ -30,24 +30,28 @@ impl From<Bump> for Arena {
30
30
31
31
#[ cfg( feature = "nightly" ) ]
32
32
unsafe impl std:: alloc:: Allocator for & ' _ Arena {
33
+ #[ inline]
33
34
fn allocate (
34
35
& self ,
35
36
layout : std:: alloc:: Layout ,
36
37
) -> Result < std:: ptr:: NonNull < [ u8 ] > , std:: alloc:: AllocError > {
37
38
std:: alloc:: Allocator :: allocate ( & & self . inner , layout)
38
39
}
39
40
41
+ #[ inline]
40
42
unsafe fn deallocate ( & self , ptr : std:: ptr:: NonNull < u8 > , layout : std:: alloc:: Layout ) {
41
43
std:: alloc:: Allocator :: deallocate ( & & self . inner , ptr, layout)
42
44
}
43
45
46
+ #[ inline]
44
47
fn allocate_zeroed (
45
48
& self ,
46
49
layout : std:: alloc:: Layout ,
47
50
) -> Result < std:: ptr:: NonNull < [ u8 ] > , std:: alloc:: AllocError > {
48
51
std:: alloc:: Allocator :: allocate_zeroed ( & & self . inner , layout)
49
52
}
50
53
54
+ #[ inline]
51
55
unsafe fn grow (
52
56
& self ,
53
57
ptr : std:: ptr:: NonNull < u8 > ,
@@ -57,6 +61,7 @@ unsafe impl std::alloc::Allocator for &'_ Arena {
57
61
std:: alloc:: Allocator :: grow ( & & self . inner , ptr, old_layout, new_layout)
58
62
}
59
63
64
+ #[ inline]
60
65
unsafe fn grow_zeroed (
61
66
& self ,
62
67
ptr : std:: ptr:: NonNull < u8 > ,
@@ -66,6 +71,7 @@ unsafe impl std::alloc::Allocator for &'_ Arena {
66
71
std:: alloc:: Allocator :: grow_zeroed ( & & self . inner , ptr, old_layout, new_layout)
67
72
}
68
73
74
+ #[ inline]
69
75
unsafe fn shrink (
70
76
& self ,
71
77
ptr : std:: ptr:: NonNull < u8 > ,
@@ -78,24 +84,28 @@ unsafe impl std::alloc::Allocator for &'_ Arena {
78
84
79
85
#[ cfg( not( feature = "nightly" ) ) ]
80
86
unsafe impl allocator_api2:: alloc:: Allocator for & ' _ Arena {
87
+ #[ inline]
81
88
fn allocate (
82
89
& self ,
83
90
layout : std:: alloc:: Layout ,
84
91
) -> Result < std:: ptr:: NonNull < [ u8 ] > , allocator_api2:: alloc:: AllocError > {
85
92
allocator_api2:: alloc:: Allocator :: allocate ( & & self . inner , layout)
86
93
}
87
94
95
+ #[ inline]
88
96
unsafe fn deallocate ( & self , ptr : std:: ptr:: NonNull < u8 > , layout : std:: alloc:: Layout ) {
89
97
allocator_api2:: alloc:: Allocator :: deallocate ( & & self . inner , ptr, layout)
90
98
}
91
99
100
+ #[ inline]
92
101
fn allocate_zeroed (
93
102
& self ,
94
103
layout : std:: alloc:: Layout ,
95
104
) -> Result < std:: ptr:: NonNull < [ u8 ] > , allocator_api2:: alloc:: AllocError > {
96
105
allocator_api2:: alloc:: Allocator :: allocate_zeroed ( & & self . inner , layout)
97
106
}
98
107
108
+ #[ inline]
99
109
unsafe fn grow (
100
110
& self ,
101
111
ptr : std:: ptr:: NonNull < u8 > ,
@@ -105,6 +115,7 @@ unsafe impl allocator_api2::alloc::Allocator for &'_ Arena {
105
115
allocator_api2:: alloc:: Allocator :: grow ( & & self . inner , ptr, old_layout, new_layout)
106
116
}
107
117
118
+ #[ inline]
108
119
unsafe fn grow_zeroed (
109
120
& self ,
110
121
ptr : std:: ptr:: NonNull < u8 > ,
@@ -114,6 +125,7 @@ unsafe impl allocator_api2::alloc::Allocator for &'_ Arena {
114
125
allocator_api2:: alloc:: Allocator :: grow_zeroed ( & & self . inner , ptr, old_layout, new_layout)
115
126
}
116
127
128
+ #[ inline]
117
129
unsafe fn shrink (
118
130
& self ,
119
131
ptr : std:: ptr:: NonNull < u8 > ,
0 commit comments