Open Bug 1543138 Opened 7 years ago Updated 3 years ago

Add generic "on leak" callback for use with XPCOM_MEM_LOG_CLASSES

Categories

(Core :: XPCOM, task, P3)

task

Tracking

()

People

(Reporter: mccr8, Unassigned)

References

Details

In bug 1531966 I added support for logging out the contents of any nsStringBuffer that leaks, when we're tracking the precise set of leaked objects. To investigate bug 1542944, I wanted a similar mechanism for XPCWrappedJS, where I wanted to know the nsIFoo for any leaked XPCWJS. I hacked this up with some ctor/dtor logging and a Python script, but it seems like we could generalize the nsStringBuffer logging by adding an optional argument to NS_LOG_ADDREF that is a void* -> void callback. This would get stored in the SerialNumberRecord. If an object leaks, we'd pass it to its callback.

In general this might require messing with the ADDREF macros, but neither nsStringBuffer and nsXPCWrappedJS use those, so I think that can be ignored for now.

Type: defect → task
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.