Two C99 features
bearophile
bearophileHUGS at lycos.com
Thu Nov 27 23:54:33 PST 2008
In C99 there are two features that may be useful in D programs too:
1) The restrict keyword:
http://en.wikipedia.org/wiki/Restrict
http://www.cellperformance.com/mike_acton/2006/05/demystifying_the_restrict_keyw.html
2) And the stack allocated variable-length arrays (that reduce most of the need for alloca() and can be used for small arrays):
http://en.wikipedia.org/wiki/Variable-length_array
This is less necessary in D because it has built-in dynamic arrays, but for small arrays it can be useful, as a performance optimization feature.
Are there proposals of adding them to D?
Bye,
bearophile
More information about the Digitalmars-d
mailing list