[phobos] opinions on bug 5370

Dmitry Olshansky dmitry.olsh at gmail.com
Fri Aug 5 14:14:35 PDT 2011


On 05.08.2011 22:04, Walter Bright wrote:
>
>
> On 8/4/2011 4:24 PM, Dmitry Olshansky wrote:
>> On 04.08.2011 7:21, Brad Roberts wrote:
>>> http://d.puremagic.com/issues/show_bug.cgi?id=5370
>>>
>>> It's listed as a regression, but it looks like a deliberate behavior 
>>> change.  My personal opinion is that buffers don't
>>> contain pointers.  They shouldn't participate in garbage collection.
>>>
>>> Either way, a decision needs to be made and either the changes 
>>> applied or the bug closed as won't fix.
>>>
>>> Thoughts?
>>
>> When I filed it I was certain it's a regression, I discovered it 
>> while chasing memory corruption in my D2 port of DMDscript.
>> All boiled down to "it works untill garbage collection", and then I 
>> found the cause:  the original code stores pointers to heap allocated 
>> objects in OutBuffer. So I think it _was_ supposed to be able to hold 
>> pointers to heap allocated stuff.
>> Also grep code for:
>> GC.clrAttr(data.ptr, GC.BlkAttr.NO_SCAN);
>> I think this made it to scan GC  before array LRU append cache. 
>> Nowdays this part of code does nothing, since it somehow doesn't 
>> point to _block_. At any rate, I can wrap up the patch as pull 
>> request if I convinced anybody.
>>
>
> Can you add a bug report about DMDScript, then?

Sorry if I'm not entirely clear on this what kind of report that would be?
If it's that it uses wrong facility (std.outbuffer) for heap allocated 
objects, the whole IR codegen is, sort of, centered over this ability. 
What should it do then if outbuffer is supposed to be NO_SCAN?
Also I think it may still scan outbuffer in D1, I never checked how the 
original source works.

-- 
Dmitry Olshansky



More information about the phobos mailing list