Hi Daniel,

> I'd like to present/discuss a recent helper, called rtl::LeakGuard which
> helps to find leaking free store objects.

To cite Thorsten: Great stuff!

> In non-pro builds, the LeakGuard OSL_ASSERTs any undestroyed (leaking)
> objects while in product builds the LeakGuard class is just plain empty
> (and does not hurt performance).

Is there a canonic place where this is is OSL_ASSERTEd (application
shutdown), or do I always have to explicitly use checkObjectCount?

The already-mentioned tools-macros had some other cool feature, which I
could imagine here: Upon app shutdown, a list was written which
contained information about all classed equipped with the DBG_XTOR
macros, stating the number of objects created, destroyed, max.existing
at a time, and leaked. While probably only the latter information is
really useful, it might be interesting to have such detection
capabilities for the LeakGuard, too.
But well, perhaps this is an issue for the yet-to-come consolidation of
the TOOLS/OSL diagnostics.


Do you have any guestimations about the impact on runtime-performance
even in non-pros, if this would be extensively used?
I mean, I'm tempted to re-fit all my UNO implementations with this
class, and those alone would probably be several hundreth classes. If
everybody would be doing this - would we have a problem in non-pros?

For the again-already-mentioned DBG_-tools, there was a rule to use them
only when needed, because else there *would* have been a problem.
Perhaps today, this is not the case anymore ...


> I have added the header to sal, because I think such a guard can be
> useful for lots of code, also in very basic libraries.

Definately yes. If the diagnostics-consolidation is ever going to
happen, and if we have a mature set of full-fledged diagnostic tools in
OSL then, I'd appreciate this class being moved to OSL, too.

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Database                   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


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

Reply via email to