Closed Bug 420514 Opened 13 years ago Closed 13 years ago
add knowledge of edge names to cycle collector, ifdef DEBUG
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.
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.
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.
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: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta5
You need to log in before you can comment on or make changes to this bug.