Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jets: let +bex create atoms 256MB or more (#464)
In testing, I commonly use `=a (bex (bex 29))` as a way to use 128MB of memory. It's been annoying that you can't do 256MB or more in this way, because the +bex jet didn't support it. This PR raises that limit to strictly less than 2GB. This also reduces the ephemeral memory usage of the `+bex` jet on large numbers by half. This was limited to strictly less than 256MB because it used a gmp method to perform the binary exponent. I briefly looked at whether gmp would handle double-length words for the exponent, but decided it was simpler and more efficient anyway to write this jet directly, ie allocate `a+1` bits and set the `a`th bit. This saves one copy of the entire result, and allows it to function up to 2GB minus one. This function would work correctly above this limit, but there are other parts of the system that seem to implicitly assume that atoms cannot be 2GB or larger. The first one I ran into was `mug`, but there may be others; after all, for a long time it was safe to assume nothing could be larger than 2GB because that was the loom size.
- Loading branch information