zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #16988
Re: [Merge] lp:~zorba-coders/zorba/feature-mem_size into lp:zorba
>
> > The size of XmlTree is not counted.
>
> Right: because it's shared by all nodes in the tree.
>
> > An instance of XmlTree is shared by all nodex in the same xml tree. Maybe
> the size of the XmlTree should be attribute only to the root node of the tree.
>
>
> The problem is infinite recursion. If I ask for the size of a tree, it's the
> sum of all the nodes. If the root node includes the size of the tree, then it
> will recurse infinitely.
>
> - Paul
I don't understand the infinite recursion problem. What I have in mind is add an alloc_size() method to the XmlNode class, which will return 0 if the node is not a root, otherwise returm mem_sizeof(XmlTree).
--
https://code.launchpad.net/~zorba-coders/zorba/feature-mem_size/+merge/114764
Your team Zorba Coders is subscribed to branch lp:zorba.
Follow ups
References