POV-Ray : Newsgroups : povray.off-topic : Teach yourself C++ in 21 days : Re: Days 5- Server Time
29 Jul 2024 10:23:13 EDT (-0400)
  Re: Days 5-  
From: Darren New
Date: 28 Apr 2012 12:57:43
Message: <4f9c2187$1@news.povray.org>
On 4/28/2012 9:52, Warp wrote:
> level were 50,

I understand your argument. I'm unconvinced that you're (a) not already 40 
levels of stack deep when you get invoked, and (b) know what your stack 
recursion depth can be.

Maybe I'm just used to working on machines with actual limited address space 
and RAM. 50 levels of recursion sounds like a lot of stack space used, to me.

 >   It's highly unusual to require enormous amounts of stack on one single
function call,

I would think that depends on the program. If you're making an image of your 
input data for each level, you're screwed, which is why people tend not to 
do that sort of thing. If (maybe) you're parsing a programming language, I 
can see each level having a fairly large amount of data associated with it.

> would require something like 1024 terabytes of RAM. How likely are you going
> to run out of stack space with that few recursion levels? You could easily
> have that many function calls on the stack even without recursion.)

That's my point! :-)

>> Why does C++ limit the depth of template instantiation required to 17
>> levels, or whatever it is?
>
>    Never heard of such a limit.

IIRC, template function nesting is only required to be supported to some 
realtively small depth.

-- 
Darren New, San Diego CA, USA (PST)
   "Oh no! We're out of code juice!"
   "Don't panic. There's beans and filters
    in the cabinet."


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.