scope of malloc

Richard Caley rjc at uk.ac.ed.cstr
Tue Nov 13 23:50:34 AEST 1990


In article <14437 at smoke.brl.mil> gwyn at smoke.brl.mil (Doug Gwyn) writes:

    It's not simply a compiler issue; many interesting computer achitectures
    are such that alloca() cannot be reasonably implemented, particularly if
    you take into account interrupts (signals).

    In article <2182 at kraftbus.opal.cs.tu-berlin.de> net at tubopal.UUCP (Oliver Laumann) writes:
    >You also keep mentioning the argument that alloca() is not needed.  If
    >this is true, then how do you make sure that in the following
    >function, [ simple callback scheme... ]

    I don't write spaghetti code.

My someone got out of bed the wrong side one Monday morning :-)

The code that was shown was not particularly opaque and was certainly
not unusual, it is the kind of thing that anyone putting together
generally useful support routines is going to have to do. 

As you point out, the same thing happens with interrupts.

Also, to tie in another thread, since one can't do line at a time
input without dynamically alocating memory, are we to assume that any
code of mine which is to be included in a larger system beyond my
control may not do line at a time input? Or are we all to live in
programmer heaven where all systems are one man jobs and are not
modified once completed?

--
rjc at uk.ac.ed.cstr



More information about the Comp.lang.c mailing list