From owner-freebsd-hackers Wed Jul 7 20: 4:23 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from assaris.sics.se (assaris.sics.se [193.10.66.108]) by hub.freebsd.org (Postfix) with ESMTP id A375315485 for ; Wed, 7 Jul 1999 20:04:18 -0700 (PDT) (envelope-from assar@sics.se) Received: (from assar@localhost) by assaris.sics.se (8.9.3/8.7.3) id FAA22684; Thu, 8 Jul 1999 05:04:45 +0200 (CEST) To: Dag-Erling Smorgrav Cc: Jamie Howard , freebsd-hackers@FreeBSD.ORG, tech-userlevel@netbsd.org, tech@openbsd.org Subject: Re: Replacement for grep(1) (part 2) References: <5laet8b2l8.fsf@assaris.sics.se> Mime-Version: 1.0 (generated by tm-edit 7.68) Content-Type: text/plain; charset=US-ASCII From: Assar Westerlund Date: 08 Jul 1999 05:04:45 +0200 In-Reply-To: Dag-Erling Smorgrav's message of "07 Jul 1999 23:01:13 +0200" Message-ID: <5lemij265u.fsf@assaris.sics.se> Lines: 25 X-Mailer: Gnus v5.5/Emacs 19.34 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dag-Erling Smorgrav writes: > > And besides, I really don't think this is a grep function but actually > > is useful for programs that don't have any strategy for handling out > > of memory errors and might as well die (with a descriptive error > > message, of course). Let's call it emalloc and let's put in somewhere > > where it can be used. > > Too simple to warrant that, and other programs will likely want to > handle the error differently. I don't agree. 1. this is a small function, but it's useful in lots of programs 2. that helps lazy programmers write code that actually checks for error returns instead of just ignoring them 3. it helps lots of programs that don't do anything intelligent (or for which there isn't much bright things to do) when allocating memory fails 4. having it in a library means it's more likely to be correct (i.e. sz == 0) but then again, I don't get to decide what goes in *BSD libc/libutil. In my library there's already a emalloc, ecalloc, and erealloc. /assar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message