From 6b1a5e8b1b20abcecfb388ca1aede31b599770f2 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Tue, 11 Jan 2022 22:27:15 +0000 Subject: [PATCH] Address review feedback --- Cargo.toml | 9 ++++++++- src/ion/data_structures.rs | 2 +- src/lib.rs | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6538eb0..de7c373 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,5 +28,12 @@ overflow-checks = true [features] default = [] + +# Enables generation of DefAlloc edits for the checker. checker = [] -fuzzing = ["arbitrary", "checker"] + +# Enables detailed logging which can be somewhat expensive. +trace-log = [] + +# Exposes the internal API for fuzzing. +fuzzing = ["arbitrary", "checker", "trace-log"] diff --git a/src/ion/data_structures.rs b/src/ion/data_structures.rs index e0f9c47..2bc4e3b 100644 --- a/src/ion/data_structures.rs +++ b/src/ion/data_structures.rs @@ -604,7 +604,7 @@ pub struct Stats { // the most significant field to the least significant one. // // These work best when the fields are stored in reverse order in memory so that -// they can be loaded with a single u64 load. +// they can be loaded with a single u64 load on little-endian machines. #[inline(always)] pub fn u64_key(b: u32, a: u32) -> u64 { a as u64 | (b as u64) << 32 diff --git a/src/lib.rs b/src/lib.rs index 3946508..800dd4f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,7 +16,7 @@ // performance cost so we disable it in release builds. macro_rules! trace { ($($tt:tt)*) => { - if cfg!(debug_assertions) { + if cfg!(feature = "trace-log") { ::log::trace!($($tt)*); } };