On Mon, Jun 24, 2013 at 6:22 PM, David DENG <
david...@gmail.com> wrote:
> So this should be considered as a bug of the compiler? It's not easy to be
> found.
As people have said upthread, the bug is that the GC is not precise.
People are actively working on that.
Because the GC is not precise, the contents of the stack are treated
as pointers even when they are not live. That causes the GC to retain
memory blocks that it should not.
Ian
> On Tuesday, June 25, 2013 9:02:15 AM UTC+8, Ian Lance Taylor wrote:
>>
>> On Mon, Jun 24, 2013 at 5:40 PM, Jack Valmadre <
jack.v...@gmail.com>
>> wrote:
>> >
>> > I thought that the purpose of Dmitry's clear() function was to zero out
>> > the
>> > stack past the current frame, so that there would be no lingering bits
>> > which
>> > point at the slice's array. Is that much correct?
>>
>> I see. You're right, but the issue arises when the function is
>> called, because Go doesn't by default zero out the frame when it
>> enters a function. That is, preclearing the stack avoids confusion
>> after entering the function.
>>
>> Ian
>