Subject: Re: Many thanks and a new question...
To: Jeremy Cooper <jeremy@broder.com>
From: Joshua Dinerstein <forge@netbsd.warped.com>
List: tech-kern
Date: 07/21/1997 15:08:58
> > 	Is there any way, with the options available inside the kernel, to 
> > determine what the available amount of "stack" for the kernel functions 
> > is? So that I can tell specifically if I am coming close to the edge.
> > 
> > 	And if it is the stack is there a way around this problem? To 
> > increase the size of the stack in the kernel? Or do I just have MALLOC my 
> > own block of temporary space and stuff all of the variables into it?
> 
> The correct approach is to malloc().  The 44BSD VM system was designed to
> handle these small and frequent allocations for the very reason that large
> kernel stack allocation can cause problems.  Don't be afraid to use it,
> that's what it's for!

	Ok. Thanks for the info. But this leads me to another couple of
questions: 

	1- There appear to be 2 malloc functions in the kernel: MALLOC and 
malloc. These 2 functions are taking quite a different set of arguments. 
Which one are you suggesting I use here?

	2- What is the MALLOC function for? (Specifically) And when 
should it be used over the malloc function.

	3- Vice versa for the malloc function. When should it be used instead 
of MALLOC. The MALLOC allows you to set the "type" of memory to be allocated.


	As you can tell I am little confused by this but none of the 
documents I have found talk about this at all. If you know of a resource 
that discusses why things were done in the way they were I would love to 
know about it. :)

	Joshua