Need to allocate arrays of instrument and envelope data- but allocate
just as many as are needed. Unless input file *specifies* number, we
don't know in advance, and I don't want to make the thing go through
*twice*, that's just nasty.

So, my solution for the moment is:
-Let input file say what the number is, but
-Make parser use "alloca" to allocate new elements on the fly, to store
 data as it's parsed; then at the end, there will be counts for each
 type of storage; malloc blocks sized appropriately for each category.
-Then go through the elements and copy them into the mallocced block.
-Blocks produced by alloca would be freed when that function exits, so it
 should do before rest of program runs.
-Alloca is not very portable, and seems ill-defined; but allocating from
 the stack, it not only is fast, but it doesn't fragment the heap either,
 like 100s of little mallocs would do.
-Could alternatively just have a set of arrays big enough to store whatever
 comes along, but I don't like that idea. Hmm, *except*, those arrays could
 be local to the parsing function, and therefore would be freed when it
 exits, *just like* the alloca blocks :) Except the alloca blocks would be
 exactly as much as is needed, and the arrays would be way in excess.
-Could support *both*, for cases where alloca doesn't work :)
-If we'd even want alloca that is...

Other pages to see (and bookmark in E2!)
 malloc pooling
 malloc abuse?
 stack pointer?
 alloca()
Other pages bookmarked in Firehamster
