Hidden allocations (Was: Array literals REALLY should be immutable )
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Thu Nov 12 09:41:37 PST 2009
Denis Koroskin wrote:
> On Thu, 12 Nov 2009 19:49:58 +0300, dsimcha <dsimcha at yahoo.com> wrote:
>
>> == Quote from Denis Koroskin (2korden at gmail.com)'s article
>>> I strongly believe that "No hidden allocation" policy should be
>>> adopted by
>>> D/Phobos (it is already adopted by Tango with a great success).
>>
>> I can see the value in this, but two issues:
>>
>> 1. What counts as a "hidden" allocation? How non-obvious does it
>> have to be that
>> something requires an allocation? If something really has to allocate
>> and it's
>> not obvious from the nature of the function, is it enough to just
>> document it?
>>
>
> I can't give a formal definition of that, but for me a is allowed to
> allocate if it produces something new or unique.
>
> For example, void mkdirRecurse(string pathname) shouldn't allocate, but
> it does, because the author didn't care about allocations when
> implemented it.
Please bugzilla that, thanks. I'll fix.
Andrei
More information about the Digitalmars-d
mailing list