From owner-freebsd-hackers Wed Dec 20 3:26:49 2000 From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 20 03:26:47 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from kai.qix.co.uk (kai.qix.co.uk [195.149.39.121]) by hub.freebsd.org (Postfix) with ESMTP id 958CD37B400 for ; Wed, 20 Dec 2000 03:26:46 -0800 (PST) Received: from localhost (aledm@localhost) by kai.qix.co.uk (8.9.3/8.9.3) with ESMTP id LAA00480; Wed, 20 Dec 2000 11:25:36 GMT (envelope-from aledm@qix.co.uk) Date: Wed, 20 Dec 2000 11:25:36 +0000 (GMT) From: Aled Morris To: Matt Dillon Cc: Jack Rusher , "Jacques A. Vidrine" , Warner Losh , hackers@FreeBSD.ORG Subject: Re: Why not another style thread? (was Re: cvs commit: src/lib/libc/gen .. In-Reply-To: <200012181908.eBIJ8PP46165@earth.backplane.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 18 Dec 2000, Matt Dillon wrote: > void * > safe_malloc(int bytes) > { > void *ptr; > > if ((ptr = malloc(bytes)) == NULL) > *(int *)0 = 1; /* force seg fault */ Shouldn't you use "kill(0, SIGSEGV)" ? I'm sure we went through a long and painful Y2K style code clearout eliminating the assumption that address zero could be referenced "*(int *0) == 0" and now you are relying on the opposite assumption. Was: Not every machine is a VAX! Now: Not every machine is not a VAX! Aled To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message