From owner-freebsd-net Tue Nov 14 14:59:36 2000 Delivered-To: freebsd-net@freebsd.org Received: from mail.interware.hu (mail.interware.hu [195.70.32.130]) by hub.freebsd.org (Postfix) with ESMTP id 8FE1F37B4FE for ; Tue, 14 Nov 2000 14:59:26 -0800 (PST) Received: from gaborone-34.budapest.interware.hu ([195.70.52.162] helo=elischer.org) by mail.interware.hu with esmtp (Exim 3.16 #1 (Debian)) id 13vp2y-0002jq-00; Tue, 14 Nov 2000 23:59:24 +0100 Message-ID: <3A11329A.D54E17E3@elischer.org> Date: Tue, 14 Nov 2000 04:39:54 -0800 From: Julian Elischer X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en MIME-Version: 1.0 To: Bosko Milekic Cc: David Malone , iedowse@maths.tcd.ie, freebsd-net@freebsd.org Subject: Re: M_RDONLY: review & comment References: Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Bosko Milekic wrote: > > On Sun, 12 Nov 2000, David Malone wrote: > > > The other option I thought of is to use a char *. You could point > > to a static string describing the type of external storage. This > > way is still fast comparing types, just compare the pointers. If > > you want to know what the type is in human readable format (for > > debugging) you just look at the string it points at. Also the > > kernel allocates different addresses for different strings, so > > it automatically solves the problem of allocating unique numbers > > to each type. > > > > David. > using char * is unsafe if the aim is to tag mbufs that were allocated by some module, if the midule is unloaded.. (the mbufs may hang around in some queu way afte the module has gone.. and an attempt to follow the char 8 pointer......) -- __--_|\ Julian Elischer / \ julian@elischer.org ( OZ ) World tour 2000 ---> X_.---._/ presently in: Budapest v To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message