Subject: Re: Adding a size parameter to stackgap_init()
To: Christos Zoulas <christos@zoulas.com>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: tech-kern
Date: 03/17/2002 18:26:12
Christos Zoulas wrote:
> This is to avoid 'struct proc *p = curproc; /* XXX */' in the code.

Well, ~all those comments should be removed IMHO. using curproc
is generally OK (if you know that the routine is supposed to be
called in context of process which it's for, what is normally
the case) even in MP kernels (on MULTIPROCESSOR kernels, 'curproc'
is per-processor value), and it's cheap. It's actually cheaper than
passing the proc pointer around through number of nested function calls.

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.org/Ports/i386/ps2.html
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-