@@ -181,16 +181,11 @@ impl<T> TypedArena<T> {
181
181
if let Some ( last_chunk) = chunks. last_mut ( ) {
182
182
let used_bytes = self . ptr . get ( ) as usize - last_chunk. start ( ) as usize ;
183
183
let currently_used_cap = used_bytes / mem:: size_of :: < T > ( ) ;
184
- if last_chunk. storage . reserve_in_place ( currently_used_cap, n) {
185
- self . end . set ( last_chunk. end ( ) ) ;
186
- return ;
187
- } else {
188
- new_capacity = last_chunk. storage . capacity ( ) ;
189
- loop {
190
- new_capacity = new_capacity. checked_mul ( 2 ) . unwrap ( ) ;
191
- if new_capacity >= currently_used_cap + n {
192
- break ;
193
- }
184
+ new_capacity = last_chunk. storage . capacity ( ) ;
185
+ loop {
186
+ new_capacity = new_capacity. checked_mul ( 2 ) . unwrap ( ) ;
187
+ if new_capacity >= currently_used_cap + n {
188
+ break ;
194
189
}
195
190
}
196
191
} else {
@@ -318,19 +313,11 @@ impl DroplessArena {
318
313
let ( chunk, mut new_capacity) ;
319
314
if let Some ( last_chunk) = chunks. last_mut ( ) {
320
315
let used_bytes = self . ptr . get ( ) as usize - last_chunk. start ( ) as usize ;
321
- if last_chunk
322
- . storage
323
- . reserve_in_place ( used_bytes, needed_bytes)
324
- {
325
- self . end . set ( last_chunk. end ( ) ) ;
326
- return ;
327
- } else {
328
- new_capacity = last_chunk. storage . capacity ( ) ;
329
- loop {
330
- new_capacity = new_capacity. checked_mul ( 2 ) . unwrap ( ) ;
331
- if new_capacity >= used_bytes + needed_bytes {
332
- break ;
333
- }
316
+ new_capacity = last_chunk. storage . capacity ( ) ;
317
+ loop {
318
+ new_capacity = new_capacity. checked_mul ( 2 ) . unwrap ( ) ;
319
+ if new_capacity >= used_bytes + needed_bytes {
320
+ break ;
334
321
}
335
322
}
336
323
} else {
0 commit comments