Skip to content

Conversation

@camshaft
Copy link
Contributor

@camshaft camshaft commented Nov 3, 2023

Description of changes:

I've been doing some experimentation with performance and made a few changes that didn't seem like they all warranted their own PR.

  • Added inline to several functions that were missing it in the hot path
  • Added an ensure! macro that works similar to s2n-tls's ENSURE macros to make it easier to follow code (instead of saying "if not this, then return an error" it says "ensure this is true, otherwise return an error)
  • Exported more of the platform internals. Since this is an internal crate we don't have any stability guarantees.
  • impl TryFrom<VarInt> for {u8,u16,u32}

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@camshaft camshaft marked this pull request as ready for review November 3, 2023 16:15

/// Checks that the first argument is true, otherwise returns the second value
#[macro_export]
macro_rules! ensure {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this naming makes sense for someone not familiar with the s2n-tls version? What about something like assert_or?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@camshaft camshaft merged commit a6a8a4c into main Nov 3, 2023
@camshaft camshaft deleted the camshaft/minor-fixes branch November 3, 2023 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants