On 2011-11-03 16:01, Andrej Mitrovic wrote:
On 11/3/11, Denis Shelomovskij<[email protected]>  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

Reply via email to