@@ -72,7 +72,7 @@ impl SegmentedAlloc {
72
72
/// allocator, or it will not be used, and will not be freed
73
73
unsafe fn create_carrier (
74
74
size_class : SizeClass ,
75
- ) -> Result < * mut SlabCarrier < LinkedListLink , ThreadSafeBlockBitSubset > , AllocErr > {
75
+ ) -> Result < * mut SlabCarrier < LinkedListLink , ThreadSafeBlockBitSubset > , AllocError > {
76
76
let size = SUPERALIGNED_CARRIER_SIZE ;
77
77
assert ! ( size_class. to_bytes( ) < size) ;
78
78
let carrier_layout = Layout :: from_size_align_unchecked ( size, size) ;
@@ -87,7 +87,7 @@ impl SegmentedAlloc {
87
87
88
88
unsafe impl AllocRef for SegmentedAlloc {
89
89
#[ inline]
90
- fn alloc ( & mut self , layout : Layout , init : AllocInit ) -> Result < MemoryBlock , AllocErr > {
90
+ fn alloc ( & mut self , layout : Layout , init : AllocInit ) -> Result < MemoryBlock , AllocError > {
91
91
if layout. size ( ) >= self . sbc_threshold {
92
92
return unsafe { self . alloc_large ( layout, init) } ;
93
93
}
@@ -102,7 +102,7 @@ unsafe impl AllocRef for SegmentedAlloc {
102
102
new_size : usize ,
103
103
placement : ReallocPlacement ,
104
104
init : AllocInit ,
105
- ) -> Result < MemoryBlock , AllocErr > {
105
+ ) -> Result < MemoryBlock , AllocError > {
106
106
if layout. size ( ) >= self . sbc_threshold {
107
107
// This was a single-block carrier
108
108
//
@@ -122,7 +122,7 @@ unsafe impl AllocRef for SegmentedAlloc {
122
122
layout : Layout ,
123
123
new_size : usize ,
124
124
placement : ReallocPlacement ,
125
- ) -> Result < MemoryBlock , AllocErr > {
125
+ ) -> Result < MemoryBlock , AllocError > {
126
126
if layout. size ( ) >= self . sbc_threshold {
127
127
// This was a single-block carrier
128
128
//
@@ -152,7 +152,7 @@ impl SegmentedAlloc {
152
152
& mut self ,
153
153
layout : Layout ,
154
154
init : AllocInit ,
155
- ) -> Result < MemoryBlock , AllocErr > {
155
+ ) -> Result < MemoryBlock , AllocError > {
156
156
// Ensure allocated region has enough space for carrier header and aligned block
157
157
let data_layout = layout. clone ( ) ;
158
158
let data_layout_size = data_layout. size ( ) ;
@@ -198,9 +198,9 @@ impl SegmentedAlloc {
198
198
new_size : usize ,
199
199
placement : ReallocPlacement ,
200
200
init : AllocInit ,
201
- ) -> Result < MemoryBlock , AllocErr > {
201
+ ) -> Result < MemoryBlock , AllocError > {
202
202
if placement != ReallocPlacement :: MayMove {
203
- return Err ( AllocErr ) ;
203
+ return Err ( AllocError ) ;
204
204
}
205
205
206
206
// Allocate new carrier
@@ -263,7 +263,7 @@ impl SegmentedAlloc {
263
263
/// allocator, or it will not be used, and will not be freed
264
264
unsafe fn create_slab_carrier (
265
265
size_class : SizeClass ,
266
- ) -> Result < * mut SlabCarrier < LinkedListLink , ThreadSafeBlockBitSubset > , AllocErr > {
266
+ ) -> Result < * mut SlabCarrier < LinkedListLink , ThreadSafeBlockBitSubset > , AllocError > {
267
267
let size = SUPERALIGNED_CARRIER_SIZE ;
268
268
assert ! ( size_class. to_bytes( ) < size) ;
269
269
let carrier_layout = Layout :: from_size_align_unchecked ( size, size) ;
@@ -280,11 +280,11 @@ impl SegmentedAlloc {
280
280
& mut self ,
281
281
layout : Layout ,
282
282
init : AllocInit ,
283
- ) -> Result < MemoryBlock , AllocErr > {
283
+ ) -> Result < MemoryBlock , AllocError > {
284
284
// Ensure allocated region has enough space for carrier header and aligned block
285
285
let size = layout. size ( ) ;
286
286
if unlikely ( size > Self :: MAX_SIZE_CLASS . to_bytes ( ) ) {
287
- return Err ( AllocErr ) ;
287
+ return Err ( AllocError ) ;
288
288
}
289
289
let size_class = self . size_class_for_unchecked ( size) ;
290
290
let index = self . index_for ( size_class) ;
@@ -327,9 +327,9 @@ impl SegmentedAlloc {
327
327
new_size : usize ,
328
328
placement : ReallocPlacement ,
329
329
init : AllocInit ,
330
- ) -> Result < MemoryBlock , AllocErr > {
330
+ ) -> Result < MemoryBlock , AllocError > {
331
331
if unlikely ( new_size > Self :: MAX_SIZE_CLASS . to_bytes ( ) ) {
332
- return Err ( AllocErr ) ;
332
+ return Err ( AllocError ) ;
333
333
}
334
334
let size = layout. size ( ) ;
335
335
let size_class = self . size_class_for_unchecked ( size) ;
@@ -344,7 +344,7 @@ impl SegmentedAlloc {
344
344
// Otherwise we have to allocate in the new size class,
345
345
// copy to that new block, and deallocate the original block
346
346
if placement != ReallocPlacement :: MayMove {
347
- return Err ( AllocErr ) ;
347
+ return Err ( AllocError ) ;
348
348
}
349
349
let align = layout. align ( ) ;
350
350
let new_layout = Layout :: from_size_align_unchecked ( new_size, align) ;
0 commit comments