Any way to track memory allocations?

Jarrett Billingsley jarrett.billingsley at gmail.com
Tue Feb 24 17:29:12 PST 2009


On Tue, Feb 24, 2009 at 8:23 PM, Daniel Keep
<daniel.keep.lists at gmail.com> wrote:

> Yup.
>
> It's a pity that we don't have, oh I don't know, some sort of efficient
> iterable interface that doesn't cause a heap allocation that the runtime
> could use instead *cough*hint*cough*andrei*cough*ranges*cough*.

You can use "foreach(k; aa)" and "foreach(_, v; aa)".

The thing is they're not always substitutes for .keys and .values.
For example, if you want to modify the AA during the foreach loop, you
have to use something like "foreach(k; aa.keys)" since you need a
"snapshot" of the keys as they were before you started modifying it.


More information about the Digitalmars-d-learn mailing list