Hi Gareth,

Thanks for your answer.

My question was about the memory allocation of DOMNodeList itself.
As I use DOMNode::getElementsByTagname() a  lot, sometimes even in a loop,
what I am concerning indeed is when the LIST will be released. So after I
post my question I created a test program to see how much memory it will
take to call getElementsByTagname() for 10000 times. The result is quite
satisfying and I don't worry about it anymore. However, I'm still quite
interested in how it is done.

Best Regards

Lei

----- Original Message -----
From: "Gareth Reakes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 07, 2003 6:14 PM
Subject: Re: DOMNodeList memory allocation?


> Hi,
> the nodes point to each other and so there is not a large storage
> of node pointers in a container. Is this the information you want?
>
> Gareth
>
>
> On Fri, 4 Jul 2003, jiang lei wrote:
>
> > Hi everybody,
> >
> > Everytime I use the method DOMNode::getElementsByTagname() I am quite
> > worried about the memory allocation. That method returns a pointer to
> > DOMNodeList, which stores node pointers in a temporary place.
> >
> > So it came to me like there are possibly 2  pattern for the making of  a
> > DOMNodeList:
> >
> > 1. the newly created DOMNodeList takes memory from a memory pool or
register
> > itself to a memory manager. When the node or document is released,
> > corresponding DOMNodeList will be destructed as well.
> >
> > 2. there can only be 1 instance of a DOMNodeList at a time for each
DOMNode.
> > Each time you use getElementsByTagname(), the old will be gone and a new
> > list will be created in its place.
> >
> > Am I right? Or is there another pattern?
> >
> > Thanks a lot for your attention.
> >
> > Best Regards
> >
> > Lei
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> --
> Gareth Reakes, Head of Product Development  +44-1865-203192
> DecisionSoft Limited                        http://www.decisionsoft.com
> XML Development and Services
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to