malloc() in kernel and increasing mbuf and cluster size

kamal kc kamal_ckk at yahoo.com
Mon Oct 17 05:27:02 PDT 2005


> > sys/malloc.h has function prototypes for malloc()
> > kern/kern_malloc.c defines the malloc()
> > 
> > the malloc() definition is
> > 
> > void *
> > malloc(size, type, flags)
> > 	unsigned long size;
> > 	struct malloc_type *type;
> > 	int flags;
> > 
> > i understand the size and flags but what shall i 
> > do with the malloc_type.
> 
> man 9 malloc :-)
> 

i saw the man pages.

it says to use malloc_type via 

MALLOC_DEFINE(type,shortdesc,longdesc)
MALLOC_DECLARE(type)

the man pages use M_FOOBUF(where did it come from ??)
in the field type.

Now how should i code it.

struct malloc_type  mytype;
mytype=MALLOC_DEFINE(.....,"mybuffers","mybuffers");

what should i put in the type field ??

thanks in advance,
kamal







		
__________________________________ 
Yahoo! Music Unlimited 
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/


More information about the freebsd-net mailing list