Skip to content

Commit

Permalink
Fix pipe tests
Browse files Browse the repository at this point in the history
I don't really understand why the size is that high.
The size of the `Message` struct is 2416.
The channel is a message in an unsafecell + 1 atomicU8 and 2 atomic bools.
It should only 3 more bytes but for some reason it's 16
  • Loading branch information
sosthene-nitrokey committed Feb 22, 2023
1 parent 4944904 commit 8fdeefd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,14 @@ pub struct ServiceEndpoint<'pipe, I: 'static, C> {

#[cfg(test)]
mod tests {
use super::{TrussedRequester, TrussedResponder};
use crate::api::{Reply, Request};
use core::mem;

// The following checks are used to ensure that we don’t accidentally increase the interchange
// size. Bumping the size is not a breaking change but should only be done if really
// necessary.

const MAX_SIZE: usize = 2416;
const MAX_SIZE: usize = 2432;

fn assert_size<T>() {
let size = mem::size_of::<T>();
Expand All @@ -65,6 +64,7 @@ mod tests {
#[test]
fn test_interchange_size() {
use interchange::Channel;
// The real cost per-client
assert_size::<Channel<Request, Reply>>();
}
}

0 comments on commit 8fdeefd

Please sign in to comment.