-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor - FunctionRegistry #484
Conversation
0a5c3c2
to
f6fa3a3
Compare
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() ?
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
|
Unifies the function registries of
Executable
andBuiltinProgram
.