#12313: Fix yet another memory leak caused by caching of coercion data
----------------------------+-----------------------------------------------
Reporter: SimonKing | Owner: rlm
Type: defect | Status: needs_work
Priority: major | Milestone: sage-5.0
Component: memleak | Keywords: coercion weak dictionary
Work_issues: Split ticket | Upstream: N/A
Reviewer: | Author: Simon King
Merged: | Dependencies: #715
----------------------------+-----------------------------------------------
Comment(by SimonKing):
Python's name mangling sucks.
Name mangling occurs when an attribute is requested whose name starts with
double underscores and does not end with an underscore. Thus, it happens
when `S.__cached_method` is requested in the code above.
However, for a reason that I don't understand, Python does not use the
name of the class of S for mangling, but the name of cls -- for example,
if `S==ZZ` then Python is looking for `S._Groupoid__cached_methods`, not
`S._<name of class of S>__cached_methods`. In addition, since
`__cached_methods` is a cpdef attribute, it should not be subject to name
mangling at all.
I'll see if doing things in Cython helps.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12313#comment:11>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.