[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [HACKERS] Preventing stack-overflow crashes (improving on
From:       Matthew Kirkwood <matthew () hairy ! beasts ! org>
Date:       2003-12-31 17:49:49
Message-ID: Pine.LNX.4.58.0312311749190.13563 () sphinx ! mythic-beasts ! com
[Download RAW message or body]

On Wed, 31 Dec 2003, Tom Lane wrote:

> > Is ABS enough on a 64-bit architecture ?
>
> That was pseudocode, I wasn't actually planning to rely on a function.
> Something more like
>
> 	long	diff;

FWIW, ISO has a ptrdiff_t, which may be useful here.

Matthew.

> 	diff = stack_base_ptr - &stack_top_loc;
> 	if (diff < 0)
> 		diff = -diff;
> 	if (diff > max)
> 		elog ...
>
> 			regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>                http://archives.postgresql.org
>
>

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic