Skip to content
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

jets: fix bex overallocation #248

Open
wants to merge 1 commit into
base: status
Choose a base branch
from

Conversation

barter-simsum
Copy link
Contributor

fixes: #246

@barter-simsum barter-simsum self-assigned this Jul 6, 2024
@@ -310,7 +310,7 @@ pub mod util {
if arg < 63 {
DirectAtom::new_unchecked(1 << arg).as_atom()
} else {
let (mut atom, dest) = IndirectAtom::new_raw_mut_bitslice(stack, (arg + 7) >> 3);
let (mut atom, dest) = IndirectAtom::new_raw_mut_bitslice(stack, (arg + 7) >> 5);
Copy link

Choose a reason for hiding this comment

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

The old code was correct for bytes. This new code wouldn't be quite right for 32 bit words, but Ares is using 64 bit words.

32-bit: (arg + 31) >> 5
64-bit: (arg + 63) >> 6

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.

jets::bits::util::bex() overallocates by 8x
2 participants