December 31, 2003

Poem

Poem in Love with Myself

Poem that Takes an Hour to Upload

Poem of Forgotten Evenings

Poem of Coroners

          sound of axes
                    and African retribution
          I've pretended not to know you long enough
                                                                              Africa
                    and I pretend
                    standing at this bus stop
                    in a coat
                    that resembles my father's
                    the bank father.
          Long slender line reminds me that it's nearly Christmas.

Posted by Brian Stefans at December 31, 2003 02:02 PM | TrackBack
Comments

Let's take a moment to reexamine that. What we've done here is create two variables. The first variable is in the Heap, and we're storing data in it. That's the obvious one. But the second variable is a pointer to the first one, and it exists on the Stack. This variable is the one that's really called favoriteNumber, and it's the one we're working with. It is important to remember that there are now two parts to our simple variable, one of which exists in each world. This kind of division is common is C, but omnipresent in Cocoa. When you start making objects, Cocoa makes them all in the Heap because the Stack isn't big enough to hold them. In Cocoa, you deal with objects through pointers everywhere and are actually forbidden from dealing with them directly.

Posted by: Lionel at January 18, 2004 09:19 PM

This is another function provided for dealing with the heap. After you've created some space in the Heap, it's yours until you let go of it. When your program is done using it, you have to explicitly tell the computer that you don't need it anymore or the computer will save it for your future use (or until your program quits, when it knows you won't be needing the memory anymore). The call to simply tells the computer that you had this space, but you're done and the memory can be freed for use by something else later on.

Posted by: Elizabeth at January 18, 2004 09:20 PM

When a variable is finished with it's work, it does not go into retirement, and it is never mentioned again. Variables simply cease to exist, and the thirty-two bits of data that they held is released, so that some other variable may later use them.

Posted by: Oliver at January 18, 2004 09:20 PM

Our next line looks familiar, except it starts with an asterisk. Again, we're using the star operator, and noting that this variable we're working with is a pointer. If we didn't, the computer would try to put the results of the right hand side of this statement (which evaluates to 6) into the pointer, overriding the value we need in the pointer, which is an address. This way, the computer knows to put the data not in the pointer, but into the place the pointer points to, which is in the Heap. So after this line, our int is living happily in the Heap, storing a value of 6, and our pointer tells us where that data is living.

Posted by: Leonard at January 18, 2004 09:21 PM

Being able to understand that basic idea opens up a vast amount of power that can be used and abused, and we're going to look at a few of the better ways to deal with it in this article.

Posted by: Jasper at January 18, 2004 09:22 PM