Following the first comment on this question: What makes this function run much slower?
Does the garbage collector sweep stack memory? From what I've read, usually gc's don't do this.
Following this question, I imagine that there is no physical difference between stack and heap memory; is there a virtual division? What I mean is: what happens when theoretically all stack memory is used without causing an overflow and new memory is allocated to an object after that?
Could someone elaborate on how this actually works? Thanks.
call,ret,pushandpop, dealing with the stack registeresp(on intel). Very low-level. It's a region of RAM set up by the OS to handle function calls. Acallwouldpushthe offset of the next instruction onto the stack and thenjmpto the called function. The function terminates withret, whichpops the return address andjmps there. Heap on the other hand is a region of memory set up by the OS, usually after the program image, and can be resized with a kernel call. It is managed withmallocandfreelibrary functions. - Kenney