[Python-Dev] stack check on Unix: any suggestions?

Thomas Wouters thomas@xs4all.net
Tue, 29 Aug 2000 22:02:27 +0200


On Tue, Aug 29, 2000 at 03:52:32PM -0400, Barry A. Warsaw wrote:

> >>>>> "M" == M  <mal@lemburg.com> writes:
> 
>     |     print i,resource.getrusage(resource.RUSAGE_SELF)   
> 
> My experience echos yours here MAL -- I've never seen anything 
> from getrusage() that would be useful in this context. :/

Ack. indeed. Nevermind my longer post then, getrusage() is usageless. (At
least on Linux.)

> A configure script test would be useful, but you'd have to build a
> minimal Python interpreter first to run the script, wouldn't you?

Nah, as long as you can test how many recursions it would take to run out of
stack... But it's still not optimal: we're doing a check at compiletime (or
rather, configure-time) on a limit which can change during the course of a
single process, nevermind a single installation ;P And I don't really like
doing a configure test that's just a program that tries to run out of
memory... it might turn out troublesome for systems with decent sized
stacks.

(getrlimit *does* work, so if we have getrlimit, we can 'calculate' the
maximum number of recursions from that.)

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!