D2 port of Tango

Jacob Carlborg doob at me.com
Fri Nov 4 00:30:13 PDT 2011


On 2011-11-03 16:01, Andrej Mitrovic wrote:
> On 11/3/11, Denis Shelomovskij<verylonglogin.reg at gmail.com>  wrote:
>> * the worst case, if you provide a large enough buffer, you are (I was)
>> completely sure Tango will use it (you want to do a manual memory
>> management by some reason), *but* it will reallocate a new one from GC
>> if it just don't like yours
>>
>
> That sounds really weird. So it takes your array buffer as a ref
> argument and resizes it / reallocates it if it's not big enough? I've
> never used Tango so I don't quite understand how it works. If I pass a
> static array or its slice of it, it can't do much except maybe throw
> an exception if it's not big enough. Hidden memory allocations are
> superbad!

Since most functions in Phobos don't accept a buffer parameter it would 
always need to allocate. How is that better? Or are you meaning that 
then you know it will always allocate.

Don't know what happens if a static array is not big enough.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-announce mailing list