POV-Ray : Newsgroups : povray.off-topic : Random C craziness : Re: Random C craziness Server Time
7 Sep 2024 11:25:49 EDT (-0400)
  Re: Random C craziness  
From: Invisible
Date: 25 Jul 2008 10:04:59
Message: <4889dd8b$1@news.povray.org>
>> Yes, but jumping to a function pushes a return address onto the stack. 
>> And they specifically don't want to do that. (Because it would use an 
>> unbounded amount of stack.)
> 
>   Functions in C don't need to return anything.

The idea here is that we jump to one label, then jump to another, then 
jump to another, never returning to the "caller".

If we implement this using C functions that never return, an unbounded 
amount of stack gets eaten.

Hence, they arranged for each function to *return* the function it would 
like to jump to next, rather than actually jumping to it, and the loop I 
posted is apparently the magic incantation that implements the jumping.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

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