@@ -72,7 +72,7 @@ impl SegmentedAlloc {
7272 /// allocator, or it will not be used, and will not be freed
7373 unsafe fn create_carrier (
7474 size_class : SizeClass ,
75- ) -> Result < * mut SlabCarrier < LinkedListLink , ThreadSafeBlockBitSubset > , AllocErr > {
75+ ) -> Result < * mut SlabCarrier < LinkedListLink , ThreadSafeBlockBitSubset > , AllocError > {
7676 let size = SUPERALIGNED_CARRIER_SIZE ;
7777 assert ! ( size_class. to_bytes( ) < size) ;
7878 let carrier_layout = Layout :: from_size_align_unchecked ( size, size) ;
@@ -87,7 +87,7 @@ impl SegmentedAlloc {
8787
8888unsafe impl AllocRef for SegmentedAlloc {
8989 #[ 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 > {
9191 if layout. size ( ) >= self . sbc_threshold {
9292 return unsafe { self . alloc_large ( layout, init) } ;
9393 }
@@ -102,7 +102,7 @@ unsafe impl AllocRef for SegmentedAlloc {
102102 new_size : usize ,
103103 placement : ReallocPlacement ,
104104 init : AllocInit ,
105- ) -> Result < MemoryBlock , AllocErr > {
105+ ) -> Result < MemoryBlock , AllocError > {
106106 if layout. size ( ) >= self . sbc_threshold {
107107 // This was a single-block carrier
108108 //
@@ -122,7 +122,7 @@ unsafe impl AllocRef for SegmentedAlloc {
122122 layout : Layout ,
123123 new_size : usize ,
124124 placement : ReallocPlacement ,
125- ) -> Result < MemoryBlock , AllocErr > {
125+ ) -> Result < MemoryBlock , AllocError > {
126126 if layout. size ( ) >= self . sbc_threshold {
127127 // This was a single-block carrier
128128 //
@@ -152,7 +152,7 @@ impl SegmentedAlloc {
152152 & mut self ,
153153 layout : Layout ,
154154 init : AllocInit ,
155- ) -> Result < MemoryBlock , AllocErr > {
155+ ) -> Result < MemoryBlock , AllocError > {
156156 // Ensure allocated region has enough space for carrier header and aligned block
157157 let data_layout = layout. clone ( ) ;
158158 let data_layout_size = data_layout. size ( ) ;
@@ -198,9 +198,9 @@ impl SegmentedAlloc {
198198 new_size : usize ,
199199 placement : ReallocPlacement ,
200200 init : AllocInit ,
201- ) -> Result < MemoryBlock , AllocErr > {
201+ ) -> Result < MemoryBlock , AllocError > {
202202 if placement != ReallocPlacement :: MayMove {
203- return Err ( AllocErr ) ;
203+ return Err ( AllocError ) ;
204204 }
205205
206206 // Allocate new carrier
@@ -263,7 +263,7 @@ impl SegmentedAlloc {
263263 /// allocator, or it will not be used, and will not be freed
264264 unsafe fn create_slab_carrier (
265265 size_class : SizeClass ,
266- ) -> Result < * mut SlabCarrier < LinkedListLink , ThreadSafeBlockBitSubset > , AllocErr > {
266+ ) -> Result < * mut SlabCarrier < LinkedListLink , ThreadSafeBlockBitSubset > , AllocError > {
267267 let size = SUPERALIGNED_CARRIER_SIZE ;
268268 assert ! ( size_class. to_bytes( ) < size) ;
269269 let carrier_layout = Layout :: from_size_align_unchecked ( size, size) ;
@@ -280,11 +280,11 @@ impl SegmentedAlloc {
280280 & mut self ,
281281 layout : Layout ,
282282 init : AllocInit ,
283- ) -> Result < MemoryBlock , AllocErr > {
283+ ) -> Result < MemoryBlock , AllocError > {
284284 // Ensure allocated region has enough space for carrier header and aligned block
285285 let size = layout. size ( ) ;
286286 if unlikely ( size > Self :: MAX_SIZE_CLASS . to_bytes ( ) ) {
287- return Err ( AllocErr ) ;
287+ return Err ( AllocError ) ;
288288 }
289289 let size_class = self . size_class_for_unchecked ( size) ;
290290 let index = self . index_for ( size_class) ;
@@ -327,9 +327,9 @@ impl SegmentedAlloc {
327327 new_size : usize ,
328328 placement : ReallocPlacement ,
329329 init : AllocInit ,
330- ) -> Result < MemoryBlock , AllocErr > {
330+ ) -> Result < MemoryBlock , AllocError > {
331331 if unlikely ( new_size > Self :: MAX_SIZE_CLASS . to_bytes ( ) ) {
332- return Err ( AllocErr ) ;
332+ return Err ( AllocError ) ;
333333 }
334334 let size = layout. size ( ) ;
335335 let size_class = self . size_class_for_unchecked ( size) ;
@@ -344,7 +344,7 @@ impl SegmentedAlloc {
344344 // Otherwise we have to allocate in the new size class,
345345 // copy to that new block, and deallocate the original block
346346 if placement != ReallocPlacement :: MayMove {
347- return Err ( AllocErr ) ;
347+ return Err ( AllocError ) ;
348348 }
349349 let align = layout. align ( ) ;
350350 let new_layout = Layout :: from_size_align_unchecked ( new_size, align) ;
0 commit comments