Christopher Smith wrote:
Darren New wrote:
The compiler can look at that and know that i never goes out of bounds
and not bother to generate array bounds checks.

Yeah... any good optimizer will do this for you. C++ actually makes its
job easier.

Easier than what? I can't imagine how the C++ compiler can tell statically that I'm not running off a dynamically-allocated array. Are you telling me that if I had a "smart array" class, the compiler can optimize away the checks inside the class when I pass it the right calls? I'd think you would at a minimum have to inline the code for that to work, and it would seem to make the compiler's job a lot harder, deducing that what you have is essentially what a different language would specify from the start.

and when you don't... you can use C/C++.

Or pragma it off. :-)

--
  Darren New / San Diego, CA, USA (PST)
    His kernel fu is strong.
    He studied at the Shao Linux Temple.

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to