Changes between Initial Version and Version 1 of Ticket #14058, comment 13


Ignore:
Timestamp:
02/06/13 15:09:09 (9 years ago)
Author:
SimonKing
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14058, comment 13

    initial v1  
    1111Both r_A and r_B are stored with a strong reference in a cache located in C, with weak keys A and B. At the same time, they are stored with a weak reference in the coercion model, again with weak keys A and B. r_A has strong references to C and to A, r_B has strong references to C and to B.
    1212
    13 What do we want? Do we want that keeping C alive makes A and B survive? Or do we want that keeping both A and B makes C survive?
     13What do we want? Do we want that keeping C alive makes A and B survive? Or do we want that keeping both A and B alive makes C survive?
    1414
    1515If the user has a strong reference to C, then C has a strong reference to r_A and r_B (in its coerce cache), and r_A/r_B strongly refers to A/B. Hence, the existence of C keeps A and B alive. Since C is a complicated object, it is more likely to be mortal, hence, probably it is not much of a problem.
     
    1919However, isn't it just a reference cycle between C and r_A/r_B? It would not prevent C from becoming collectable, right?
    2020
    21 I doubt that we want that. It is not desirable that, when adding elements of ZZ['x'] and QQ, the ring QQ['x'] is created repeatedly (OK, polynomial rings have a strong cache anyway. But you see what I mean).
     21I doubt that we want that. It is not desirable that, when adding elements of `ZZ['x']` and QQ, the ring `QQ['x']` is created repeatedly (OK, polynomial rings have a strong cache anyway. But you see what I mean).
    2222
    2323Or did I misunderstand something?