@@ -407,6 +407,8 @@ impl Default for DroplessArena {
407
407
#[ inline]
408
408
fn default ( ) -> DroplessArena {
409
409
DroplessArena {
410
+ // We set both `start` and `end` to 0 so that the first call to
411
+ // alloc() will trigger a grow().
410
412
start : Cell :: new ( ptr:: null_mut ( ) ) ,
411
413
end : Cell :: new ( ptr:: null_mut ( ) ) ,
412
414
chunks : Default :: default ( ) ,
@@ -417,7 +419,7 @@ impl Default for DroplessArena {
417
419
impl DroplessArena {
418
420
fn grow ( & self , layout : Layout ) {
419
421
// Add some padding so we can align `self.end` while
420
- // stilling fitting in a `layout` allocation.
422
+ // still fitting in a `layout` allocation.
421
423
let additional = layout. size ( ) + cmp:: max ( DROPLESS_ALIGNMENT , layout. align ( ) ) - 1 ;
422
424
423
425
unsafe {
@@ -441,7 +443,7 @@ impl DroplessArena {
441
443
let mut chunk = ArenaChunk :: new ( align_up ( new_cap, PAGE ) ) ;
442
444
self . start . set ( chunk. start ( ) ) ;
443
445
444
- // Align the end to DROPLESS_ALIGNMENT
446
+ // Align the end to DROPLESS_ALIGNMENT.
445
447
let end = align_down ( chunk. end ( ) . addr ( ) , DROPLESS_ALIGNMENT ) ;
446
448
447
449
// Make sure we don't go past `start`. This should not happen since the allocation
0 commit comments