template-depth

Phil Edwards pedwards@disaster.jaj.com
Sun Dec 24 18:46:00 GMT 2000


On Fri, Dec 22, 2000 at 04:58:38PM -0800, Mike Stump wrote:
>
> I have a user that reported that the library uses 14 levels all by
> itself in their code, leaving them with 3 levels for the application.
[...]
> ! /* Maximum template instantiation depth. The standard library code
> !    uses up to around 14 levels all by itself, and on top of that we'd

That sounds like a library bug, or rather a design problem.  Any idea
where in the library this occurs?


> Normally, I'd just add a zero, but
> I didn't convince myself the runtime would be inconsequential.
> 
> Thoughts?

I'm not an expect in that part of the code, but...

If the users have the available memory and feel like doing heavy/evil
template things, the runtime is going to be the same whether we set a
large max_tinst_depth or they use a large -ftemplate-depth-NN, right?
Why limit NN to be low arbitrarily?  It doesn't affect building GCC, or
the cc1plus binary size, or the cc1plus runtime if no templates are used,
or if only a few levels are used, right?


Phil

-- 
pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools.  Fools are protected by more capable fools.


More information about the Gcc-patches mailing list