Subject: Re: wd.c patch to reduce kernel stack usage
To: Jaromir Dolecek <jdolecek@netbsd.org>
From: Andrey Petrov <petrov@netbsd.org>
List: tech-kern
Date: 06/27/2002 13:22:57
On Thu, Jun 27, 2002 at 10:07:50PM +0200, Jaromir Dolecek wrote:
> Would using
>
> switch (retval) {
> case ERROR:
> {
> char buf[256], *errbuf = &buf;
>
> /* do error handling */
>
> break;
> }
>
> suffice?
Well, it's still on stack. I'm not sure that elimination of stack is
a justifiable goal, stack memory is much faster then malloc'd one and
it less error-prone(no need to free, no memory leaks). If I'd worried
about stack size I'd use unmapped red-zone as vax/sparc ports do first.
Andrey