Debugging memory leak.
renoX
renosky at free.fr
Tue Oct 9 00:23:41 PDT 2007
Sean Kelly a écrit :
> Frits van Bommel wrote:
>> Sean Kelly wrote:
>>
>>>> - Try Tango? Is the GC different there?
>>>
>>> Somewhat, but void[] arrays are still treated as if they have pointers.
>>
>> But AFAICT tango.io.compress.Zlib doesn't allocate any of those, just
>> ubyte[] arrays, and exception classes. (The unittest does use a
>> MemoryConduit, which internally uses a void[], but nothing else should
>> allocate void[]s for that module)
>
> Yup. However, an annoying problem still exists with Buffer. Basically,
> this class maintains a void[] reference to a block of memory allocated
> as a byte[]. However, if the block is resized for any reason, the type
> doing the resizing is used to determine whether the newly allocated
> block contains pointers. I've been meaning to change the Tango runtime
> and GC to preserve array block attributes across reallocations, but it's
> a somewhat involved process and I haven't gotten to it yet.
>
>
> Sean
IMHO, that's a different issue: the compress prototype should be
modified to indicates that it returns byte[] not void[]: after all, no
pointer is expected in compressed data, so the function signature should
reflect this.
Regards,
renoX
More information about the Digitalmars-d
mailing list