#15367: Empty lists while creating parents
---------------------------+-------------------------
       Reporter:  roed     |        Owner:
           Type:  defect   |       Status:  new
       Priority:  major    |    Milestone:  sage-5.13
      Component:  memleak  |   Resolution:
       Keywords:           |    Merged in:
        Authors:           |    Reviewers:
Report Upstream:  N/A      |  Work issues:
         Branch:           |       Commit:
   Dependencies:           |     Stopgaps:
---------------------------+-------------------------

Comment (by SimonKing):

 With the old code, it would have been relatively easy to create a
 dictionary with a fixed key size (e.g. a dictionary such that all keys are
 5-tuples of objects that are weak-refd if possible and compared by
 identity).

 One question we might address: How difficult would this be with the new
 code you are suggesting? You are defining `cdef struct mono_cell` and
 `cdef struct triple_cell`. One might think of this definition
 {{{
 cdef struct tuple_cell:
     void** key_id_list
     PyObject** key_weakref_list
     PyObject* value
 }}}
 and then a `KeytupleDict` (or whatever we call it) would allocate enough
 memory for n pointers (n being the key size of the dictionary) both for
 `key_id_list` and `key_weakref_list`, for each item it stores. At first
 glance, your code looks like not difficult to generalise.

 So, do you think we should have `MonoDict` and `TripleDict` for hard-coded
 key length and then (on a different ticket?) `KeytupleDict` for arbitrary
 fixed key length?

--
Ticket URL: <http://trac.sagemath.org/ticket/15367#comment:15>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to