Closed Bug 420514 Opened 17 years ago Closed 16 years ago

add knowledge of edge names to cycle collector, ifdef DEBUG_CC

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9beta5

People

(Reporter: dbaron, Assigned: dbaron)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch patch (obsolete) — Splinter Review
For a bunch of cycle collector debugging stuff I've wanted names for the edges.  This adds them in a way that makes providing an edge name optional, makes it so that all the traversal macros provide edge names (which means two of them need to require edge names as a parameter, but that hits a total of four (?) callers outside of nsCycleCollectionParticipant.h), reports the edge names in some of the DEBUG_CC code, and adds edge name information to a few of the callers that I happened to care about today.
Attachment #306795 - Flags: superreview?(peterv)
Attachment #306795 - Flags: review?(peterv)
Attached patch patchSplinter Review
Oops, that introduced an nsCStringArray leak (not memory, but ctor/dtor matching) since we constructed the PtrInfo twice.  This makes it so we allocate NodePool::Block with NS_Alloc/NS_Free instead of new/delete so we don't do that.
Assignee: nobody → dbaron
Attachment #306795 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #306814 - Flags: superreview?(peterv)
Attachment #306814 - Flags: review?(peterv)
Attachment #306795 - Flags: superreview?(peterv)
Attachment #306795 - Flags: review?(peterv)
Comment on attachment 306814 [details] [diff] [review]
patch

>diff --git a/xpcom/glue/nsCycleCollectionParticipant.h b/xpcom/glue/nsCycleCollectionParticipant.h
>--- a/xpcom/glue/nsCycleCollectionParticipant.h
>+++ b/xpcom/glue/nsCycleCollectionParticipant.h

>-#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSTARRAY(_array, _element_class)     \
>+#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSTARRAY(_array, _element_class, _name) \

Maybe rewrap this.
Attachment #306814 - Flags: superreview?(peterv)
Attachment #306814 - Flags: superreview+
Attachment #306814 - Flags: review?(peterv)
Attachment #306814 - Flags: review+
Comment on attachment 306814 [details] [diff] [review]
patch

This is mostly DEBUG_CC only, and helps quite a bit when debugging leaks, but it does add a bunch of calls to macros (that are empty when DEBUG_CC is not defined) to non-DEBUG_CC code, so I should probably request approval for it.
Attachment #306814 - Flags: approval1.9?
Comment on attachment 306814 [details] [diff] [review]
patch

a1.9+=damons
Attachment #306814 - Flags: approval1.9? → approval1.9+
Checked in to trunk.

We can certainly add names for more edges in later patches, but I'll mark this bug fixed at this point.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: