Referrer logs show that I’m getting a moderate amount of attention from searchers who look for the name of a basketball player for the Lakers and other topics such as “identity” and, sadly, “rape.” Of course, the link that Goggle directs them to comes from a conversation last year between Margaret and me — nothing to do with the present struggle over consent or violence. Which will not satisfy their curiosity, but may alleviate some of the tension associated with these dreadful topics.
Posted by AKMA at July 22, 2003 11:24 AM | TrackBackThe Stack is just what it sounds like: a tower of things that starts at the bottom and builds upward as it goes. In our case, the things in the stack are called "Stack Frames" or just "frames". We start with one stack frame at the very bottom, and we build up from there.
Posted by: Goughe at January 13, 2004 03:14 AMInside each stack frame is a slew of useful information. It tells the computer what code is currently executing, where to go next, where to go in the case a return statement is found, and a whole lot of other things that are incredible useful to the computer, but not very useful to you most of the time. One of the things that is useful to you is the part of the frame that keeps track of all the variables you're using. So the first place for a variable to live is on the Stack. This is a very nice place to live, in that all the creation and destruction of space is handled for you as Stack Frames are created and destroyed. You seldom have to worry about making space for the variables on the stack. The only problem is that the variables here only live as long as the stack frame does, which is to say the length of the function those variables are declared in. This is often a fine situation, but when you need to store information for longer than a single function, you are instantly out of luck.
Posted by: Mary at January 13, 2004 03:14 AMThe most basic duality that exists with variables is how the programmer sees them in a totally different way than the computer does. When you're typing away in Project Builder, your variables are normal words smashed together, like software titles from the 80s. You deal with them on this level, moving them around and passing them back and forth.
Posted by: Valentine at January 13, 2004 03:14 AMThe rest of our conversion follows a similar vein. Instead of going through line by line, let's just compare end results: when the transition is complete, the code that used to read:
Posted by: Reginald at January 13, 2004 12:30 PMEach Stack Frame represents a function. The bottom frame is always the main function, and the frames above it are the other functions that main calls. At any given time, the stack can show you the path your code has taken to get to where it is. The top frame represents the function the code is currently executing, and the frame below it is the function that called the current function, and the frame below that represents the function that called the function that called the current function, and so on all the way down to main, which is the starting point of any C program.
Posted by: Prospero at January 13, 2004 12:30 PMLet's see an example by converting our favoriteNumber variable from a stack variable to a heap variable. The first thing we'll do is find the project we've been working on and open it up in Project Builder. In the file, we'll start right at the top and work our way down. Under the line:
Posted by: Tabitha at January 13, 2004 12:30 PM