[Uml-devel] mmgen update

Andrew Sutton ansutton at kent.edu
Thu Feb 27 17:59:04 UTC 2003


On Thursday 27 February 2003 4:52 pm, Luis De la Parra Blum wrote:
> On Thursday 27 February 2003 18:21, Andrew Sutton wrote:
> > refMetaObject and refMofId). also, i'm going to build some reference
> > counting capabilities into refBaseObject so i don't have to sweat the
>
> I think you should just use smart pointers (either standard or boost).
> Managing memory in machine generated code has to be  *really* difficult, so
> unless you keep all your objects in the stack (which I doubt you will) I'd
> go for some kind of smart pointer and no try to reinvent the wheel there.

not a bad idea, but there is a bit of a problem - templating all these classes 
is going to result in code bloat. it'll probably double the size of all the 
libraries. besides, then i'd have to rewrite all my generation routines to 
spit out templates :) oh - using smart pointers might also get in the way of 
the class hierarchies. i'm not entirely sure how i could get around that.

actually, the memory management isn't too hard. there's really only a couple 
places where references need to be addressed. we can also use Qt signals to 
help out. somehow. anyway, it shouldn't be too bad. as we figure out where 
we're leaking memory, we can tweak the generator, rewrite the metamodel and 
test it again.

andy




More information about the umbrello-devel mailing list