From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 17 13:31:19 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5283616A41F; Mon, 17 Oct 2005 13:31:19 +0000 (GMT) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 83E8D43D46; Mon, 17 Oct 2005 13:31:18 +0000 (GMT) (envelope-from doconnor@gsoft.com.au) Received: from inchoate.gsoft.com.au (ppp211-138.lns1.adl2.internode.on.net [203.122.211.138]) (authenticated bits=0) by cain.gsoft.com.au (8.13.4/8.13.4) with ESMTP id j9HDVFuO040733 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Mon, 17 Oct 2005 23:01:15 +0930 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: freebsd-hackers@freebsd.org Date: Mon, 17 Oct 2005 23:01:03 +0930 User-Agent: KMail/1.8.2 References: <20051017122657.58723.qmail@web35703.mail.mud.yahoo.com> In-Reply-To: <20051017122657.58723.qmail@web35703.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1889844.n68iqsc57Q"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200510172301.10658.doconnor@gsoft.com.au> X-Spam-Score: 0.05 () FORGED_RCVD_HELO X-Scanned-By: MIMEDefang 2.51 on 203.31.81.10 Cc: kamal kc , freebsd-net@freebsd.org Subject: Re: malloc() in kernel and increasing mbuf and cluster size X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2005 13:31:19 -0000 --nextPart1889844.n68iqsc57Q Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Mon, 17 Oct 2005 21:56, kamal kc wrote: > the man pages use M_FOOBUF(where did it come from ??) > in the field type. 'foo' is a generic term for a random variable name. > Now how should i code it. > > struct malloc_type mytype; > mytype=3DMALLOC_DEFINE(.....,"mybuffers","mybuffers"); > > what should i put in the type field ?? Read the man page!! /* sys/something/foo_extern.h */ MALLOC_DECLARE(M_FOOBUF); /* sys/something/foo_main.c */ MALLOC_DEFINE(M_FOOBUF, "foobuffers", "Buffers to foo data into the ether"); /* sys/something/foo_subr.c */ ... MALLOC(buf, struct foo_buf *, sizeof *buf, M_FOOBUF, M_NOWAIT); Read other code, there are plenty of examples in the tree. =2D-=20 Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C --nextPart1889844.n68iqsc57Q Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQBDU6ee5ZPcIHs/zowRAnuYAJ9GwEylrj8dC3y2wpxVWwXvnwGeuwCgh0L2 +iRcqEliPhd21JD6ENAZF7Y= =KgSV -----END PGP SIGNATURE----- --nextPart1889844.n68iqsc57Q--