February 05, 2003

Two poems from my underwear drawer

Document 1

Is this what it’s like to sleep
in a pile of corpses?
(Poetry is an afterthought.)
I woke up because my dentures were dirty
and all the thinking was like 1975.
She was there. So was she.
And she was there. We called her Gullible Madness.

The pose of the “pulse in Soho”
makes my hair follicles breathe
but that’s before I was disabused
of the inevitability
(houses made of Saran Wrap)
of the inevitability of death.
I can’t say I feel much better now.

When they had that hinge joint installed in the putter
I was the star of a TV series
that took place in Cleveland, but was secretly filmed
in Toronto – why’d they do that?
As the days grow longer, I become an emphatic 7.


Bohemian Birdsong

A little melancholy, a little tragedy, a little Zoloft
adds to a man’s character.
Here are the poems of Frank Lima
rewritten for you, since I can’t afford his book, Inventory (selected poems).
A little heart cutting strings
means that your cosmopolitan tourette’s hasn’t entirely alienated you
from those who might love
you. It’s like a famous rapper’s style
that’s somehow mellowed in the plastic wrap, but is good snuggling music.
I just cooked three different dishes of the “white trash”
variety, like Mom used to make.
I’ll bring them to work, I’ll mix them all up, I’ll be richly contented.

Posted by Brian Stefans at February 5, 2003 01:59 PM
Comments

When compared to the Stack, the Heap is a simple thing to understand. All the memory that's left over is "in the Heap" (excepting some special cases and some reserve). There is little structure, but in return for this freedom of movement you must create and destroy any boundaries you need. And it is always possible that the heap might simply not have enough space for you.

Posted by: Benedict at January 18, 2004 07:03 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: Mark at January 18, 2004 07:03 PM

We can see an example of this in our code we've written so far. In each function's block, we declare variables that hold our data. When each function ends, the variables within are disposed of, and the space they were using is given back to the computer to use. The variables live in the blocks of conditionals and loops we write, but they don't cascade into functions we call, because those aren't sub-blocks, but different sections of code entirely. Every variable we've written has a well-defined lifetime of one function.

Posted by: Effemia at January 18, 2004 07:04 PM

Note first that favoriteNumbers type changed. Instead of our familiar int, we're now using int*. The asterisk here is an operator, which is often called the "star operator". You will remember that we also use an asterisk as a sign for multiplication. The positioning of the asterisk changes its meaning. This operator effectively means "this is a pointer". Here it says that favoriteNumber will be not an int but a pointer to an int. And instead of simply going on to say what we're putting in that int, we have to take an extra step and create the space, which is what does. This function takes an argument that specifies how much space you need and then returns a pointer to that space. We've passed it the result of another function, , which we pass int, a type. In reality, is a macro, but for now we don't have to care: all we need to know is that it tells us the size of whatever we gave it, in this case an int. So when is done, it gives us an address in the heap where we can put an integer. It is important to remember that the data is stored in the heap, while the address of that data is stored in a pointer on the stack.

Posted by: Quivier at January 18, 2004 07:04 PM

To address this issue, we turn to the second place to put variables, which is called the Heap. If you think of the Stack as a high-rise apartment building somewhere, variables as tenets and each level building atop the one before it, then the Heap is the suburban sprawl, every citizen finding a space for herself, each lot a different size and locations that can't be readily predictable. For all the simplicity offered by the Stack, the Heap seems positively chaotic, but the reality is that each just obeys its own rules.

Posted by: Ebotte at January 18, 2004 07:05 PM