A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-March/042904.html below:

[Python-Dev] [ python-Patches-876206 ] scary frame speed hacks

[Python-Dev] [ python-Patches-876206 ] scary frame speed hacksArmin Rigo arigo at tunes.org
Wed Mar 3 11:22:35 EST 2004
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


More information about the Python-Dev mailing list

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