Comments (5)
Second answer
https://internals.rust-lang.org/t/when-should-i-use-inline/598
from x86_64.
I have followed the link and read the thread, but I still have a question regarding the #[inline]
attribute. In C++ an equivalent keyword also exists, but it's merely a hint for the compiler. Does Rust has a similar approach ?
from x86_64.
As far as I know, the #[inline]
attribute is just a hint for the compiler that it should consider this function for cross-crate inlining. Without the attribute, inlining across crate bounds is only performed when link time optimization is enabled.
The #[inline]
attribute is different from the #[inline(always)]
attribute, which always forces inlining and is generally discouraged (because the compiler usually knows it better).
Should all of them be marked
#[inline]
? Or should users of this crate always depend on LTO?
Forcing the users to always use LTO does not seem like the best solution. So I think it's fine to add #[inline]
to all such small functions of this crate and I'm happy to merge a PR for this.
from x86_64.
I have done #129 .
I'm not 100% sure of my modifications, hopefully it's just a hint, so the observable behaviour should not change.
Tested with cargo build
and cargo test
.
Did I miss something ?
from x86_64.
Fixed in #129.
from x86_64.
Related Issues (20)
- Set minimal scoped permissions to github workflow HOT 1
- Create a Security Policy
- Mutable references in page table implementation? HOT 1
- IDT and page table code causing trouble in Confidential Computing space HOT 1
- Hash pin workflow dependencies HOT 9
- `Descriptor::tss_segment` too restrictive? HOT 2
- recursive page table with recursive index 511 is unsound HOT 7
- How can I set 2MiB page frame in my Page Directory Table? HOT 1
- How do I map to a virtualized physical address? HOT 1
- Enable OpenSSF Scorecard Action HOT 2
- [Question] Is there a reason to not support pagemaps level 5 ? HOT 2
- Trait for Entry handler function types? HOT 2
- Should we add an register abstraction? How should it work with and ?
- `VirtAddr` arithmetic may panic HOT 2
- Returning FrameAlreadyMapped error when it shouldn't HOT 10
- Should have a way to construct an `InterruptStackFrameValue`? HOT 3
- A `VirtualAddr` panic is triggered when the page table called `clean_up` HOT 3
- `Sealed::DEBUG_STR` is publicly accessible HOT 10
- PageTable: Handling of pages without the present flag set HOT 2
- `Mapper::unmap` should be unsafe HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from x86_64.