Add some more #[inline] annotations for trivial functions (#2817)
Looking at some profiles these or their related functions were all showing up, so this commit adds `#[inline]` to allow cross-crate inlining by default.
This commit is contained in:
@@ -970,6 +970,7 @@ impl InstanceHandle {
|
||||
/// of the internals, there's no lifetime tracking around its validity.
|
||||
/// You'll need to ensure that the returned handles all go out of scope at
|
||||
/// the same time.
|
||||
#[inline]
|
||||
pub unsafe fn clone(&self) -> InstanceHandle {
|
||||
InstanceHandle {
|
||||
instance: self.instance,
|
||||
|
||||
@@ -490,17 +490,20 @@ mod test_vmshared_signature_index {
|
||||
|
||||
impl VMSharedSignatureIndex {
|
||||
/// Create a new `VMSharedSignatureIndex`.
|
||||
#[inline]
|
||||
pub fn new(value: u32) -> Self {
|
||||
Self(value)
|
||||
}
|
||||
|
||||
/// Returns the underlying bits of the index.
|
||||
#[inline]
|
||||
pub fn bits(&self) -> u32 {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for VMSharedSignatureIndex {
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
Self::new(u32::MAX)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user