Passing array as const slows down code?

Jonathan M Davis jmdavisProg at gmx.com
Fri Apr 27 14:22:14 PDT 2012


On Friday, April 27, 2012 14:00:13 H. S. Teoh wrote:
> In -release mode, array bounds checking is turned off for speed reasons.
> The idea being that before you compile with -release you've already
> extensively tested your program and are sure that simple bugs like array
> overruns have been weeded out.

The checks are actually left in for @safe code even with -release. You need -
noboundscheck to disable themin all code. But yes, many array bounds checks do 
get stripped out with -release, and you can never rely on them being there, 
because they can go away, depending on the flags.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list