Garbage collector collects live objects

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 11 08:40:10 PST 2014


On 12/10/14 7:52 AM, Ruslan Mullakhmetov wrote:
> On Wednesday, 10 December 2014 at 08:46:12 UTC, Ruslan Mullakhmetov wrote:
>> yes. that was the mistake. also after fixing bug in Blk Attributes
>> printing i got more reasonable attrs
>>
>> for object blk: FINALIZE
>> for array of objects blk: NO_SCAN APPENDABLE
>>
>> this is sound good except for NO_SCAN.
>>
>> ...
>> the other question why this happens... try to debug more.
>
> I've done more dubugging.
>
> what i've found:
>
> initially array blk has only attrs APPENDABLE, but after some time this
> blk is shrinked and reallocated (moved) and then NO_SCAN attr appears.
>
>
> here the output of my extended logs:
>
> --------
> before tag: 1 len: 2 ptr: 103DD9058 root: 103DD8000:8192 attr: APPENDABLE
> after tag: 1 len: 3 ptr: 103A21DD0 root: 103A21DC0:64 attr: NO_SCAN
> APPENDABLE
> --------
>
> this is produced by the following code
>
> http://dpaste.dzfl.pl/0c6dc16270a1
>
> so in a nutshell after appending to array via ~= operator blk attrs
> changed from APPENDABLE to NO_SCAN APPENDABLE which cause the problem.
>
> why and how this happens? can anybody explain it to me?

I have an idea of what is happening, I will do some testing. Thanks for 
debugging this so far, this is useful info.

This is *definitely* a bug, if the code you gave is what caused that 
output. Appending should not add the NO_SCAN tag.

-Steve


More information about the Digitalmars-d-learn mailing list