Skip to content

Commit 79b11f0

Browse files
committed
rustc_arena: tweak some comments.
1 parent 2ba4eb2 commit 79b11f0

File tree

1 file changed

+4
-2
lines changed
  • compiler/rustc_arena/src

1 file changed

+4
-2
lines changed

compiler/rustc_arena/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,8 @@ impl Default for DroplessArena {
407407
#[inline]
408408
fn default() -> DroplessArena {
409409
DroplessArena {
410+
// We set both `start` and `end` to 0 so that the first call to
411+
// alloc() will trigger a grow().
410412
start: Cell::new(ptr::null_mut()),
411413
end: Cell::new(ptr::null_mut()),
412414
chunks: Default::default(),
@@ -417,7 +419,7 @@ impl Default for DroplessArena {
417419
impl DroplessArena {
418420
fn grow(&self, layout: Layout) {
419421
// Add some padding so we can align `self.end` while
420-
// stilling fitting in a `layout` allocation.
422+
// still fitting in a `layout` allocation.
421423
let additional = layout.size() + cmp::max(DROPLESS_ALIGNMENT, layout.align()) - 1;
422424

423425
unsafe {
@@ -441,7 +443,7 @@ impl DroplessArena {
441443
let mut chunk = ArenaChunk::new(align_up(new_cap, PAGE));
442444
self.start.set(chunk.start());
443445

444-
// Align the end to DROPLESS_ALIGNMENT
446+
// Align the end to DROPLESS_ALIGNMENT.
445447
let end = align_down(chunk.end().addr(), DROPLESS_ALIGNMENT);
446448

447449
// Make sure we don't go past `start`. This should not happen since the allocation

0 commit comments

Comments
 (0)