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/2002-June/025612.html below:

[Python-Dev] Tcl adept wanted for Stackless problem

[Python-Dev] Tcl adept wanted for Stackless problem [Python-Dev] Tcl adept wanted for Stackless problemGuido van Rossum guido@python.org
Wed, 19 Jun 2002 11:07:36 -0400
> My big question is:
> When does Tcl use C stack entries as globals, which
> are passed as function arguments to interpreter calls?

It's a performance hack, just as stackless :-).

Tcl's interpreter data structure has a return value field which can
receive a string of arbitrary length.  In order to make this
efficient, this is initialized with a pointer to a limited-size array
on the stack of the caller; when the return value is longer, a
malloc()'ed buffer is used.  There is a little dance you have to do to
free the malloc()'ed buffer.  The big win is that most calls return
short strings and hence you save a call to malloc() and one to free()
per invocation.  This is used *all over* the Tcl source, so good luck
getting rid of it.

--Guido van Rossum (home page: http://www.python.org/~guido/)





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