[Issue 17746] Improve BigInt memory usage

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 2 15:22:03 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=17746

--- Comment #1 from Jack Stouffer <jack at jackstouffer.com> ---
>From my initial investigation into this, adding ref counting to BigInt is much
more complicated than it first appears. Adding a size_t ref count on the heap
for BigUint basically breaks the rest of BigInt because anytime BigInt is
const/immutable it makes the pointer to the reference count const/immutable as
well. Meaning, const(BigInt) is no longer implicitly convert-able to BigInt.
I'm not sure this is doable without a large rewrite.

--


More information about the Digitalmars-d-bugs mailing list