On Wed, Oct 25, 2023 at 3:12 AM Henry Rich <henryhr...@gmail.com> wrote: > OK, I see now. The implementation using low-level GMP would be more > parallel with Roger's original version, right?
The data structures would remain as they are. The memory allocation would be more along the lines of Roger's original version. > That would end up being simpler than having reserve memory, as well as > stabler. After the work has completed, yes. For testing, at least, we'd have a mixed bag where only some of the primitives have been converted. I don't anticipate any problems from this particular dichotomy though -- we have the ISGMP() macro which should probably be renamed ISGMPALLOC(), we have the X typedef which is used to represent extended integers (and the Q typedef which we use to represent a rational pair of them), and the XNUM (and RAT) defines which we use to indicate that the container holds a sequence of X (or Q) values. So the code is already factored in a fashion which should make this transition relatively painless. > Since you currently mark blocks that are to be freed by GMP, you could > make this change piecemeal, right? When you rewrite addition to use the > low-level routines, you mark the blocks allocated by addition as J not > GMP, and everything else follows automatically. Exactly. > Tbat's a great idea. Exactly - I'm glad Elijah Stone suggested it. Thanks, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm