From owner-freebsd-arch Tue Jul 24 13: 4:27 2001 Delivered-To: freebsd-arch@freebsd.org Received: from obsecurity.dyndns.org (adsl-64-169-104-149.dsl.lsan03.pacbell.net [64.169.104.149]) by hub.freebsd.org (Postfix) with ESMTP id 47FF737B407; Tue, 24 Jul 2001 13:04:20 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 4053566E04; Tue, 24 Jul 2001 13:04:19 -0700 (PDT) Date: Tue, 24 Jul 2001 13:04:18 -0700 From: Kris Kennaway To: "David E. O'Brien" Cc: arch@FreeBSD.org Subject: Nuking all malloc wrappers (Re: cvs commit: src/usr.bin/nm nm.c) Message-ID: <20010724130418.A34051@xor.obsecurity.org> References: <200107241408.f6OE83j65583@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="SUOF0GtieIMvvwua" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200107241408.f6OE83j65583@freefall.freebsd.org>; from obrien@FreeBSD.org on Tue, Jul 24, 2001 at 07:08:03AM -0700 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --SUOF0GtieIMvvwua Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I don't understand why you're doing this. Increasing code duplication by expanding out a local function seems like a pessimization to me. Many programs wrap functions that malloc, and it's the correct thing to do to increase code readability as well as making it more likely that all instances get checked for the malloc return value. It's a very big step to go from "emalloc() shouldn't exist in libutil" to "no piece of code in FreeBSD should use a private wrapper function around malloc() to simplify the process of checking the return value". Could you please explain your reasoning? Kris On Tue, Jul 24, 2001 at 07:08:03AM -0700, David E. O'Brien wrote: > obrien 2001/07/24 07:08:03 PDT >=20 > Modified files: > usr.bin/nm nm.c=20 > Log: > Expland the emalloc to do the testing at the place of mallocing. > =20 > Revision Changes Path > 1.16 +7 -17 src/usr.bin/nm/nm.c > http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/nm/nm.c.diff?r1=3D1.15= &r2=3D1.16 --SUOF0GtieIMvvwua Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7XdTCWry0BWjoQKURAo3LAJ4/hgWSdSPLG/FJvDWvY+KoANS8bQCgkAG2 GnjFBvQVcKDDJ+emdwgmNdI= =pqFa -----END PGP SIGNATURE----- --SUOF0GtieIMvvwua-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message