Unfortunately the new and delete of each object is neccessary since I need to 
change its derived type. :(

On Friday 27 October 2006 16:37, Jonathan Tarbox wrote:
> What you describe is a pool system.  Generally speaking, reseting an object
> to uninitialized state (usually via a flag or something) is faster then
> having to allocate a whole new object from memory.  However, this all
> depends on the size of the pool, how does it grow, how often does all this
> need to happen, etc..   the event system has (or had, I haven't looked at
> the code since the switch to svn..) a system similar to this method you
> describe.
>
> -jtarbox
>
> > -----Original Message-----
> > From: Genjix
> > Subject: [CsMain] csArray and csHash
> >
> > Hi,
> >
> > I'm not sure whether this is fast or just overtly complex.
> >
> > I need to build a list of nodes that can be worked on fast.
> >
> >   csArray<Node> nodes;
> >   // node id, array index
> >   csHash<VNodeID, int> node_lookup;
> >
> > So when I create a new node, I check to see if theres any unitialised
> > nodes,
> > else I create a new one and push it to nodes. Then I add a key.
> >
> > When I delete a node, I unitialise it and delete the key.
> >
> > Is there any speed advantage here? Or is this plain stupid? Should I just
> > do
> > csHash<VNodeID, Node> instead?
> >
> > As an alternative I can also use Node* instead of Node which preserves
> > memory
> > and check for NULL values, but theres a new every so often...
> >
> > Thanks.
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Crystal-main mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/crystal-main
> Unsubscribe:
> mailto:[EMAIL PROTECTED]

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]

Reply via email to