From owner-freebsd-hackers Sun Dec 17 22:47:57 2000 From owner-freebsd-hackers@FreeBSD.ORG Sun Dec 17 22:47:55 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from critter.freebsd.dk (flutter.freebsd.dk [212.242.40.147]) by hub.freebsd.org (Postfix) with ESMTP id 6EFB437B400 for ; Sun, 17 Dec 2000 22:47:54 -0800 (PST) Received: from critter (localhost [127.0.0.1]) by critter.freebsd.dk (8.11.1/8.11.1) with ESMTP id eBI6lbf26017; Mon, 18 Dec 2000 07:47:37 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: Warner Losh Cc: "Jacques A. Vidrine" , hackers@FreeBSD.ORG Subject: Re: Why not another style thread? (was Re: cvs commit: src/lib/libc/gen getgrent.c) In-Reply-To: Your message of "Sun, 17 Dec 2000 21:59:30 MST." <200012180459.VAA87790@harmony.village.org> Date: Mon, 18 Dec 2000 07:47:37 +0100 Message-ID: <26015.977122057@critter> From: Poul-Henning Kamp Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <200012180459.VAA87790@harmony.village.org>, Warner Losh writes: >Number 2. ANSI-C (aka c89) requires that free(NULL) work. We >shouldn't go out of our way to pander to those machines where it >doesn't. The reason why this is so is that it is legal for realloc(ptr, 0): to return either a NULL pointer or a real pointer, and to remain consistent, the following sequence should always be legal: ptr = malloc(foo); ptr = realloc(foo, bar); free(ptr); -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message