On Sep 18, 2013, at 01:24 PM, Tom Browder <tom.brow...@gmail.com> wrote:

As I work on the new interface, I find myself going toward a separate
arg init function for each TCLAP type we implement, each having its
own signature which parrots the TCLAP class. Then the common struct
is actually initialized behind the scenes. That way we also
piggy-back on the TCLAP manual for how to use each type.
Don't follow and probably won't until your example is complete so I'll defer
commenting further.

Okay, the new API is buildable and ready for comment. Note that my
example uses an atexit function to clean up arg memory almost
painlessly (valgrind shows TCLAP C++ memory can still use some work).
 
Will take some time to digest and review, but can say right off the bat that using atexit() for memory management trades one problem for another.  It's fine for main() functions that are only called once, but all of our command API gets called over and over again.  It will slowly acquire memory as commands are called and will eventually run out, crash, thrash, etc, or need to be shut down.

Still, that's an easy point to address, just remove it and make the caller release the memory so we're back where we were beforehand.  Now that you're done, I'll look and hopefully can see what the issue is with static memory.  Stay tuned... ;)

Cheers!
Sean





Best,

-Tom

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to