This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
forked from qmonnet/rbpf
-
Notifications
You must be signed in to change notification settings - Fork 181
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lichtso
force-pushed
the
refactor/function_registry
branch
7 times, most recently
from
July 11, 2023 16:00
0a5c3c2
to
f6fa3a3
Compare
alessandrod
requested review from
alessandrod
and removed request for
alessandrod
July 13, 2023 06:22
alessandrod
reviewed
Jul 13, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, see nits
src/elf.rs
Outdated
|
||
impl<T: Copy + PartialEq> FunctionRegistry<T> { | ||
/// Register a symbol with an explicit key | ||
pub fn register_function(&mut self, key: u32, name: Vec<u8>, value: T) -> Result<(), ElfError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and in the other register_*, it should be name: impl Into<Vec<u8>>
src/elf.rs
Outdated
} else { | ||
let mut key = [0u8; mem::size_of::<u64>()]; | ||
LittleEndian::write_u64(&mut key, usize::from(value) as u64); | ||
ebpf::hash_symbol_name(&key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&usize::from(value).to_le_bytes() ?
Lichtso
force-pushed
the
refactor/function_registry
branch
from
July 13, 2023 11:14
f6fa3a3
to
c795320
Compare
Codecov Report
@@ Coverage Diff @@
## main #484 +/- ##
==========================================
+ Coverage 89.51% 89.66% +0.15%
==========================================
Files 23 23
Lines 10055 10095 +40
==========================================
+ Hits 9001 9052 +51
+ Misses 1054 1043 -11
|
alessandrod
approved these changes
Jul 13, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unifies the function registries of
Executable
andBuiltinProgram
.