From 96614f4c7698b75198d1806c240e13c691862451 Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Mon, 20 Jan 2025 16:47:12 +0800 Subject: [PATCH] Minor comment fixes --- src/util/conversions.rs | 5 ++--- src/util/metadata/side_metadata/global.rs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/util/conversions.rs b/src/util/conversions.rs index 017cc77fc0..e62dff0392 100644 --- a/src/util/conversions.rs +++ b/src/util/conversions.rs @@ -94,9 +94,8 @@ pub fn bytes_to_formatted_string(bytes: usize) -> String { format!("{}{}", num, UNITS.last().unwrap()) } -/// Shift `num` by `bits` to the right. Add 1 to the result if any bits are shifted out to the -/// right. This is equivalent to dividing `num` by 2 to the power of `bits`, rounding towards -/// infinity. +/// Shift `num` by `bits` to the right. Add 1 to the result if any `1` bits are shifted out to the +/// right. This is equivalent to dividing `num` by 2 to the power of `bits`, rounding up. /// /// This function has undefined behavior if `bits` is greater or equal to the number of bits in /// `usize`. diff --git a/src/util/metadata/side_metadata/global.rs b/src/util/metadata/side_metadata/global.rs index ffb3fb8f44..8730602a4b 100644 --- a/src/util/metadata/side_metadata/global.rs +++ b/src/util/metadata/side_metadata/global.rs @@ -1363,7 +1363,7 @@ impl SideMetadataContext { let mut total = 0; for spec in self.global.iter() { // This rounds up. No matter how small `data_pages` is, the side metadata size will be - // at least one page. This behavior is *intended*. The over-estimated amount is used + // at least one page. This behavior is *intended*. This over-estimated amount is used // for triggering GC and resizing the heap. total += data_to_meta_size_round_up(spec, data_pages); }