Skip to content

Conversation

@ggreif
Copy link
Contributor

@ggreif ggreif commented Dec 1, 2025

No description provided.

@ggreif ggreif requested a review from a team as a code owner December 1, 2025 12:30
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 {
Copy link
Contributor Author

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)
Copy link
Contributor Author

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
Copy link
Contributor Author

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

Copy link
Contributor Author

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.

Copy link
Collaborator

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;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similarly

};
};
func setCandidTypeLimits<system>({
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants