D-Programming-Language/druntime — pull request #154 by sandford (2012-02-16 22:27:03+00:00)
Title: fix issue 6333 

Patch for Issue 6333 - The 'capacity' function is not pure/nothrow/@safe.
http://d.puremagic.com/issues/show_bug.cgi?id=6333

Adds a new _d_arraygetcapacity function which is copy / pasted / streamlined from _d_arraysetcapacity. Both _d_arraygetcapacity and _d_arraysetcapacity now always update the block cache if it is okay to do so and the info block wasn't already present.

nothrow has been added to the definitions of the get/set functions and their dependents with the exception of the raw GC calls.

pure is enabled by a hack in object.di and object_.d which defines the extern(C) as being pure. (This same trick is used to cast the GC as pure nothrow inside lifetime.d). Technically, neither of these routines are strictly pure, but then again, neither is new T[n].