Assigning global and static associative arrays

Philippe Sigaud philippe.sigaud at gmail.com
Sat Sep 1 02:07:34 PDT 2012


> Using enum can be very useful, but I wouldn't use it for AAs at all, and I'd
> be leery of using it for much in the way of arrays other than string literals
> (since the string literals should avoid the memory allocations that other
> array literals get). It's fine most other stuff, but for those items, you need
> to be very wary of it or risk lots of unnecessary GC allocations.

I guess the rule to follow is not to use enum for anything with lots
of allocation.

Why do string literals have less memory allocations?


More information about the Digitalmars-d-learn mailing list