Subject: Re: wd.c patch to reduce kernel stack usage
To: Jaromir Dolecek <jdolecek@netbsd.org>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-kern
Date: 06/27/2002 13:22:03
On Thu, Jun 27, 2002 at 10:07:50PM +0200, Jaromir Dolecek wrote:
> switch (retval) {
> case ERROR:
> {
> char buf[256], *errbuf = &buf;
>
> /* do error handling */
>
> break;
> }
>
> suffice?
I don't think it would. The compiler may allocate stack frame space for
that anyway.
Use of alloca() is one possibility. But that still comes from the stack,
do you'd want to make the buffer smaller, as well, I guess.
Reducing kernel stack usage is good ... but having to allocate memory
in an error handler doesn't seem like the best idea...
--
-- Jason R. Thorpe <thorpej@wasabisystems.com>