POV-Ray : Newsgroups : povray.general : max_trace_level : Re: max_trace_level Server Time
6 Aug 2024 00:12:20 EDT (-0400)
  Re: max_trace_level  
From: Thorsten Froehlich
Date: 20 Aug 2002 09:51:00
Message: <3d624944@news.povray.org>
In article <3d624317@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:

>   AFAIK the stack overlapping with the heap is a problem which happens only
> in Windows (and perhaps MacOS?).

Yes, but the reason is different and I assume the some problem exists on
every operating system!  Why?  Well, both Mac OS and Windows versions use
threading.  Stack space for threads has to be allocated somewhere.  And that
"somewhere" is usually the heap...

>   If I'm not completely mistaken, in most Unix systems the stack of a program
> starts from the maximum memory address which the system supports (which is
> 32-bit systems would be at least 2 gigabytes, if not 4). Since the heap starts
> from a very low memory address (typically some tens of kilobytes) it's highly
> unlikely that they will ever overlap (because usually you run out of memory
> before this happens).

Yes, but it fails with threading unless (which is possible of course, but I
don't think has ever been implemented in a widely used OS) one places the
stack into a separate address space.  This then prohibits passing of stack
variable addresses because those won't be right.  However, usually you have
a limited stack size for threads, at least that is how POSIX threads,
Windows threads and Mac OS threads work.

So all this talk about stack growing from one extreme and heap from the
others is thirty year old OS theory that is no longer relevant for modern
applications, unfortunately :-(

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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