Subject: Re: Many thanks and a new question...
To: Eric Fischer <eric@fudge.uchicago.edu>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: tech-kern
Date: 07/21/1997 20:16:48
> > MALLOC is meant to be used in critical paths, where you don't want the
> > extra overhead that a function call to malloc() might cause.
> 
> Are interrupt handlers considered critical enough to use MALLOC()
> instead of malloc()?  Or even so critical that I should be avoiding
> allocating memory at all?

That depends on the interrupt. If you're in a normal ethernet
controller interrupt service routine (for example, dp8390_get), you
have to allocate memory. However many interrupt servicers (like the
ones in the 8530 SCC driver, which I'm most familiar with) don't
allocate memory at interrupt time.

If you have to get memory to pass something along, it makes sense to
allocate it at interrupt time. But I'd think it's bad to allocate
temp data at interrupt time. Just pre-allocate a scratch buffer or
two.

Take care,

Bill