Closed Bug 61243 Opened 24 years ago Closed 24 years ago

[nsTraceRefcnt]move dynamic_cast out of NSCAP_* macros

Categories

(Core :: XPCOM, defect, P3)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla0.8

People

(Reporter: dbaron, Assigned: dbaron)

Details

Attachments

(4 files)

I've never liked having the dynamic_cast in the macros for nsCOMPtr logging.
When I first wrote it, I couldn't get it to work another way, but the trick
seems to use nsISupports* instead of void* for the function argument, and then
do the dynamic_cast within the function.

I have this in my tree, but it needs to be tested...
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.1
Looks good to me. r=waterson
Just curious why you want stub static methods for

+NS_COM void
+nsTraceRefcnt::Startup()
+{
+#ifdef NS_BUILD_REFCNT_LOGGING
+  SetActivityIsLegal(PR_TRUE);
+#endif
+}

when NS_BUILD_REFCNT_LOGGING is not defined.  Isn't the whole source file
excluded from compilation (or if not, shouldn't its contents be #ifdef'd out by
one giant #ifdef)?

School me, the answer can't stop sr=brendan@mozilla.org

/be
I did it that way because everything else in the file was done that way, and I
didn't want to change the whole file.  I'm not sure why kipp originally wrote it
that way, but I've stuck to the style.  Perhaps he wanted to avoid
optimized-only build bustage that would result from nsTraceRefcnt functions
being called when NS_BUILD_REFCNT_LOGGING is defined.

So do you think we should change it to comment out the whole file (and most of
nsTraceRefcnt.h) if NS_BUILD_REFCNT_LOGGING is not defined?  It might require a
bit of #ifdef-ing in various places, although such things should probably not be
in release builds anyway.
Target Milestone: mozilla0.9.1 → mozilla0.8
I checked in this fix way back on 2000-12-23 at 08:43 PST.  The remaining
leaks of nsTraceRefcnt's hashtables are covered by bug 63665 (with patch)
and Brendan's comments are covered by bug 66159.  Marking FIXED.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: