assert(expression, error)
spir
denis.spir at gmail.com
Sat Feb 12 08:38:45 PST 2011
On 02/12/2011 05:27 PM, Jonathan M Davis wrote:
> Aside from enforce, this function is a one-liner. It's obvious that it should be
> inlined and that it _would_ be inlined if enforce isn't used. But if I were to
> use enforce, it couldn't be inlined. It's situations like that which really
> bother me. enforce is definitely and obviously harming code efficiency in such a
> case.
Hello again Jonathan,
Maybe a good use case of what I asked for in another thread: feedback from the
compiler about whather a given func is inlinable. Imagine I don't know enforce
is problematic. After all, at first sight, I can see no obvious reason (maybe
from lack of knowledge). Then, how can one know? Could happily let it
externalisable persuaded it would /for sure/ be inlined.
In your case, tough, I think it's not problematic since there are few chances
for the func to represent a significant proportion of run time (I guess ;-). In
my case, it a func called by a parser's Node constructor! Typically a major
part of a parser's runtime is, precisely, generating millions on Nodes every
second...
Denis
--
_________________
vita es estrany
spir.wikidot.com
More information about the Digitalmars-d-learn
mailing list