-
Notifications
You must be signed in to change notification settings - Fork 37
Refactor - Removes the dense function registry from loaders #25
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
Conversation
75135da to
3f9244d
Compare
src/program.rs
Outdated
| pub fn get_function_registry( | ||
| &self, | ||
| sbpf_version: SBPFVersion, | ||
| _sbpf_version: SBPFVersion, |
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.
What about removing the unused parameter?
test_utils/src/lib.rs
Outdated
| $function_registry | ||
| .register_function_hashed($location.as_bytes(), $syscall_function) | ||
| .unwrap(); | ||
| (register, $loader:expr, $location:expr => $syscall_function:expr) => { |
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.
What about calling name instead of location?
test_utils/src/lib.rs
Outdated
| $loader.register_function($location, $syscall_function).unwrap(); | ||
| }; | ||
| ($source:tt, $config:tt, $mem:tt, ($($location:expr => $syscall_function:expr),* $(,)?), $context_object:expr, $expected_result:expr $(,)?) => { | ||
| ($source:expr, $config:expr, $mem:expr, ($($location:expr => $syscall_function:expr),* $(,)?), $context_object:expr, $expected_result:expr $(,)?) => { |
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.
Name instead of location?
test_utils/src/lib.rs
Outdated
| } | ||
| }; | ||
| ($source:tt, $mem:tt, ($($location:expr => $syscall_function:expr),* $(,)?), $context_object:expr, $expected_result:expr $(,)?) => { | ||
| ($source:expr, $mem:expr, ($($location:expr => $syscall_function:expr),* $(,)?), $context_object:expr, $expected_result:expr $(,)?) => { |
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 as well
3f9244d to
7fd164c
Compare
| use solana_sbpf::program::SBPFVersion; | ||
| use solana_sbpf::vm::Config; | ||
| use solana_sbpf::{assembler::assemble, ebpf, program::BuiltinProgram}; |
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.
Not for this PR, but we could configure cargo fmt to group imports as we do in the Agave repo.
No description provided.