Why is `Appender._data` a pointer to its `Data`-store?
schveiguy at gmail.com
Sat Oct 17 12:43:01 UTC 2020
On 10/17/20 12:00 AM, Paul Backus wrote:
> On Saturday, 17 October 2020 at 00:06:31 UTC, Steven Schveighoffer wrote:
>> Appender is ref counted IIRC.
> It's not; it uses the GC.
Oh yeah. In fact, it was me who did that (in 2010!).
My point should have been that the appender is a pImpl to avoid memory
corruption. If you have multiple copies of an appender, and each has its
own idea of what the capacity is, then you will get corruption.
See the original bug report here:
More information about the Digitalmars-d-learn