From 9eef189f3a032a081aed82566c81d5a2c87c497a Mon Sep 17 00:00:00 2001 From: Urhengulas Date: Thu, 14 Jul 2022 13:08:42 +0200 Subject: [PATCH 1/3] Fix `fn round_up`. It was hardcoding `k` as `4`. This PR changes the fn to actually use `k`. This resultet in no problem so far, because it was only used with `k=4`. --- src/canary.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/canary.rs b/src/canary.rs index 61b7ba3d..3f7ebda4 100644 --- a/src/canary.rs +++ b/src/canary.rs @@ -174,7 +174,7 @@ fn round_up(n: u32, k: u32) -> u32 { if rem == 0 { n } else { - n + 4 - rem + n + k - rem } } From b019b0d99522823af851b33084b26c6480e7e976 Mon Sep 17 00:00:00 2001 From: Urhengulas Date: Thu, 14 Jul 2022 13:11:36 +0200 Subject: [PATCH 2/3] Edit CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ca2c26f..6581b5f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ## [Unreleased] +- [#330] Fix `fn round_up` - [#329] Update probe-rs to 0.13.0 (does not yet implement 64-bit support) - [#328] Simplify, by capturing identifiers in logging macros - [#326] Make use of i/o locking being static since rust `1.61`. @@ -16,6 +17,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - [#314] Clarify documentation in README - [#293] Update snapshot tests to new TRACE output +[#330]: https://github.com/knurling-rs/probe-run/pull/330 [#329]: https://github.com/knurling-rs/probe-run/pull/329 [#328]: https://github.com/knurling-rs/probe-run/pull/328 [#326]: https://github.com/knurling-rs/probe-run/pull/326 From 70332b01736ad2c4b69e496d5f1bc9db9b0d6357 Mon Sep 17 00:00:00 2001 From: Urhengulas Date: Wed, 20 Jul 2022 19:21:56 +0200 Subject: [PATCH 3/3] Document `fn round_up` --- src/canary.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/canary.rs b/src/canary.rs index 3f7ebda4..d52c89f1 100644 --- a/src/canary.rs +++ b/src/canary.rs @@ -169,6 +169,7 @@ impl Canary { } } +/// Rounds up to the next multiple of `k` that is greater or equal to `n`. fn round_up(n: u32, k: u32) -> u32 { let rem = n % k; if rem == 0 {