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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message
- Re: Why not another style thread? (was Re: cvs commit: sr... Matt Dillon
- Re: Why not another style thread? (was Re: cvs commi... Aled Morris
- Re: Why not another style thread? (was Re: cvs c... Assar Westerlund
- Re: Why not another style thread? (was Re: c... Peter Seebach
- Re: Why not another style thread? (was R... Assar Westerlund
- Re: Why not another style thread? (was Re: c... Matt Dillon
- Re: Why not another style thread? (was R... Assar Westerlund
- Re: Why not another style thread? (... Matt Dillon
- Re: Why not another style thread? (was Re: cvs c... Peter Seebach

