On Fri, Jul 20, 2001 at 10:17:20AM +0100, vishwanath pargaonkar wrote:
> Hi,
> 
> can any one please help me with this. i want allocate
> a memory in the kernel -a buffer of size 2k to 5k.
> can i do it using malloc with second parameter as
> M_TEMP and third as M_WAITOK.
> 
> can anybody tell me what M_TEMP means .what is maximum
> malloc i can do with M_TEMP?
> will the OS allow me to malloc 4k buffer in side
> kernel??shd i give M_WAITOK or M_DONTWAIT???

        M_TEMP is merely there for statistics gathering. If you're writing
a subsystem and plan to malloc() a lot of things for the subsystem you may
want to create your own malloc type (see malloc(9)).
        On another note, remember that if you allocate a 5k buffer with malloc()
on x86 where the page size if 4k, that you're not guaranteed to have a
physically contiguous backing. 
 
> please tell me.
> thanx in advance.

Regards,
-- 
 Bosko Milekic
 [EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to