D memory consumption/runtime speed problem

bearophile bearophileHUGS at lycos.com
Thu Jan 14 23:03:03 PST 2010


sybrandy:
> private immutable uint ONE_BYTE_VAL = (1 << 6) - 1;
> private immutable uint TWO_BYTE_VAL = (1 << 14) - 1;

Use "private const" in D1 and "private enum" in D2, there's no need for an immutable here.
In your code there are now no useless memory allocations, so the exit(0) trick is not needed.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list