Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> How big is the stack? Is it a fixed size dictated by the architecture of the processor?

It's more to do with the OS or language runtime; I think the language runtime has a bigger impact for most programs.

> Other than gut feel and catching an exception after the fact, how do programmers know when their program might overflow it?

In general, you don't. You might be able to do some system-specific thing on specific systems or just happen to know what it is on some given system, but there's no way to find out in the general case. Worse, there's generally no way to recover from blowing the stack; this has always made programs written using alloca() or, more recently, variable-length arrays potentially unstable.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: