[Issue 17746] Improve BigInt memory usage

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 2 17:59:28 UTC 2018


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

--- Comment #3 from Jack Stouffer <jack at jackstouffer.com> ---
On the other hand, if the COW is to avoid issues in code like this

```
BigInt a = 10;
BigInt b = a;

++a;
assert(b == 10);
```

where b could end up equaling 11, can we just make opAssign and the this(T :
BigInt) copy the data array, and have everything else just use the in-place
data?

--


More information about the Digitalmars-d-bugs mailing list