Re: Preventing stack-overflow crashes (improving on - Mailing list pgsql-hackers

From Matthew Kirkwood
Subject Re: Preventing stack-overflow crashes (improving on
Date
Msg-id Pine.LNX.4.58.0312311749190.13563@sphinx.mythic-beasts.com
Whole thread Raw
In response to Re: Preventing stack-overflow crashes (improving on max_expr_depth)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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
>
>


pgsql-hackers by date:

Previous
From: markw@osdl.org
Date:
Subject: using stp for dbt2 + postgresql
Next
From: Jan Wieck
Date:
Subject: Re: cache in plpgsql