Often repeated array allocations

bearophile bearophileHUGS at lycos.com
Sun Jul 21 14:25:12 PDT 2013


Namespace:

> I have a float[1024] buffer which is used, as long as the 
> requested size is less than 1024. If it's greater, I will 
> temporary allocate the whole array with new float[Size];

That's one of the ways I solve similar problems.


> Any improvements? Or is 1024 to small / big?

An idea is to add some debug{} code that computes statistics for 
the array sizes...

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list