> 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