Memory allocation problem

bearophile bearophileHUGS at lycos.com
Mon Aug 10 12:46:57 PDT 2009


Jeremie Pelletier:

>I can't even think of an use for such large arrays. There is always a way to split the allocation in smaller ones which will be easy to map in the available virtual memory space.<

You not being able to imagine a good use case doesn't imply there isn't one :-)
This program allocates a very large tree in a linear data structure. The result is a much higher performance, compared to the usual tree allocated with sparse structures, or even compared to structures structures taken from one or more freelists allocated as arrays of contiguous structs. The C code runs in seconds instead of minutes, even considering a bit of hard disk trashing at the beginning. Modern CPUs love arrays much more than in the past. Linked data structures are now getting obsolete.

-------------------

div0:
> http://www.digitalmars.com/d/archives/digitalmars/D/OPTLINK_and_LARGEADDRESSAWARE_88061.html

Thank you very much, I think the case is closed.

Bye,
bearophile



More information about the Digitalmars-d mailing list