Poul-Henning Kamp wrote:
> In message <[EMAIL PROTECTED]>, Gary Jennejohn writes:
>
> >Yes, but it was perfectly legal to put the structure on the stack
> >_before_ MLEN was doubled.
>
> Just because it worked doesn't mean that it was correct.
>
> We need to be frugal about the kernel stack, for a lot of reasons,
> that's just the way it is, and as far as I know it is the way
> it will continue to be.
To be a little less harsh about it (Poul, you could _really_ stand to
work on your phrasing, this sounded unnecessarily harsh), kernel stack
space is (in pretty much any kernel -- the one I work on is Unixware 7)
a very scarce resource. You can put variables on the stack, but even
that can make it run out for really long path lengths. If you have a
structure or an array, the rule of thumb is to _always_ malloc it. This
will save your bacon when the structure grows (as in this case) or the
path gets a little longer, or something else happens that makes you run
out of kernel stack. This is the way it is in kernel land. I won't say
"get used to it," that's unnecessarily harsh, but it _is_ the way it is.
Read, learn, evolve, as they say in talk.bizarre. And become a better
kernel programmer thereby.
--
Frank Mayhar [EMAIL PROTECTED] http://www.exit.com/
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message