-
Notifications
You must be signed in to change notification settings - Fork 121
Gabor/typtbl #5693
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
base: master
Are you sure you want to change the base?
Gabor/typtbl #5693
Conversation
| const WORD_SIZE: usize = core::mem::size_of::<u32>(); | ||
|
|
||
| if (*buf).ptr.add(WORD_SIZE - 1) >= (*buf).end { | ||
| if (*buf).ptr.add(WORD_SIZE) > (*buf).end { |
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.
this is equivalent, but can CSE with below
| #[no_mangle] | ||
| unsafe extern "C" fn idl_sub_buf_words(typtbl_size1: usize, typtbl_size2: usize) -> usize { | ||
| return BitRel::words(typtbl_size1, typtbl_size2); | ||
| BitRel::words(typtbl_size1, typtbl_size2) |
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.
equivalent
| let idl_value_numerator = 1l | ||
| let idl_value_denominator = 1l | ||
| let idl_value_bias = 1024l | ||
| let idl_type_scaler = 3l |
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.
s/idl_type_/idl_typetbl_/g
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.
Maybe we should have {scaler = 1; bias = 512}, I am not sure about the current defaults.
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.
probably fine to have a larger default;
| E.add_global32 env "@@value_bias" Mutable idl_value_bias; | ||
| E.add_global64 env "@@value_quota" Mutable 0L | ||
| E.add_global64 env "@@value_quota" Mutable 0L; | ||
| E.add_global32 env "@@type_scaler" Mutable idl_type_scaler; |
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.
similarly
| }; | ||
| }; | ||
| func setCandidTypeLimits<system>({ |
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.
exposing this method to the user seems like a bit too much power/opportunity to do wrong things; no strong opinions but I wonder if this shouldn't perhaps be more like a compile-time setting, perhaps?
No description provided.