Hello Michael, On Tue, Mar 02, 2004 at 05:26:56PM +0000, Michael Hudson wrote: > But list_sort pushes quite a large object onto the stack. So if you > arrange for that too appear on the stack repeatedly, you get a crash > much earlier. > > Python's recursion limit is a nasty hack. Unfortunately, all the > alternatives are worse :-( (except some variant of stackless, I guess, > but that probably doesn't help the list_sort business). What about limiting the byte size of the C stack, instead of the recursion level? You can estimate the current size of the stack in a C program fairly easily (although it is a clear hack, I expect it to work on any platform): get the difference between a pointer to some local variable and a (previously saved) pointer to a local variable in some C frame near the bottom. Armin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4