Re: [Python-Dev] stack check on Unix: any suggestions?
My SGI has getrlimit(RLIMIT_STACK) which should do the trick. But maybe this is an sgi-ism? Otherwise RLIMIT_VMEM and subtracting brk() may do the trick. While thinking about this, though, I suddenly realised that my (new, faster) Mac implementation of PyOS_CheckStack will fail miserably in any other than the main thread, something I'll have to fix shortly. Unix code will also have to differentiate between running on the main stack and a sub-thread stack, probably. And I haven't looked at the way PyOS_CheckStack is implemented on Windows, but it may well also share this problem. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm
On Wed, Aug 30, 2000 at 01:30:01PM +0200, Jack Jansen wrote:
My SGI has getrlimit(RLIMIT_STACK) which should do the trick. But maybe this is an sgi-ism? Otherwise RLIMIT_VMEM and subtracting brk() may do the trick.
No, getrlimit(RLIMIT_STACK, &rlim) is the way to go. 'getrlimit' isn't
available everywhere, but the RLIMIT_STACK constant is universal, as far as
I know. And we can use autoconf to figure out if it's available.
--
Thomas Wouters
participants (2)
-
Jack Jansen
-
Thomas Wouters