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/2011-May/111265.html below:

[Python-Dev] Linus on garbage collection

[Python-Dev] Linus on garbage collection [Python-Dev] Linus on garbage collectionGeorg Brandl g.brandl at gmx.net
Sat May 7 08:55:57 CEST 2011
On 07.05.2011 01:25, Greg Ewing wrote:
> Neal Becker wrote:
>> http://gcc.gnu.org/ml/gcc/2002-08/msg00552.html
> 
> There, Linus says
> 
>> For example, if you have an _explicit_ refcounting system, then it is
>> quite natural to have operations like ...
>> 
>> 		note_t *node = *np;
>> 		if (node->count > 1)
>> 			newnode = copy_alloc(node);
> 
> It's interesting to note that, even though you *can* get reference
> count information in CPython, it's not all that useful for doing
> things like that, because it's hard to be sure how many incidental
> references have been created on the way to the code concerned.
> So tricks like this at the Python level aren't really feasible in
> any robust way.

But they are at the C level, see for example the optimization for

  string += something

if "string"'s reference count is exactly one.

Georg

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