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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust/ares/src/jets/bits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

dest.set(arg, true);
atom.normalize_as_atom()
}
Expand Down
Loading