Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jul 2001 13:04:18 -0700
From:      Kris Kennaway <kris@obsecurity.org>
To:        "David E. O'Brien" <obrien@FreeBSD.org>
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>
In-Reply-To: <200107241408.f6OE83j65583@freefall.freebsd.org>; from obrien@FreeBSD.org on Tue, Jul 24, 2001 at 07:08:03AM -0700
References:  <200107241408.f6OE83j65583@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010724130418.A34051>