Closed
Bug 317481
Opened 19 years ago
Closed 18 years ago
C API for nsTraceRefcnt
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
Future
People
(Reporter: dbaron, Assigned: dbaron)
References
Details
(Whiteboard: [patch])
Attachments
(2 files, 2 obsolete files)
3.88 KB,
patch
|
Details | Diff | Splinter Review | |
4.31 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
I've needed to use nsTraceRefcnt's leak logging ability from C code a number of times, most recently to debug bug 317478 (where I needed to log JS_LockGCThing and JS_UnlockGCThing as reference counting). This time I decided to take a cleaner approach and actually write a small API to do this. I'm not sure if it's really something we want to check in -- I'm curious what bsmedberg thinks.
Assignee | ||
Comment 1•19 years ago
|
||
bsmedberg, any opinions on how evil this is?
Attachment #203987 -
Flags: review?(bsmedberg)
Assignee | ||
Comment 2•19 years ago
|
||
Assignee | ||
Updated•19 years ago
|
Whiteboard: [patch]
Updated•19 years ago
|
Attachment #203987 -
Flags: review?(bsmedberg) → review?(benjamin)
Assignee | ||
Comment 3•19 years ago
|
||
The previous example for tracking lock/unlock of GC things was missing an NS_LOG_ADDREF in js_NewGCThing for objects created locked.
Attachment #203988 -
Attachment is obsolete: true
Comment 4•19 years ago
|
||
Comment on attachment 203987 [details] [diff] [review] C API for nsTraceRefcnt Well hrm, I like the idea but it seems to be a bit hackier than we actually need. Why can't we just inline the static nsTraceRefCnt methods directly to their C counterparts (or get rid of them altogether, but I suppose they are used throughout the tree and we don't want to go on a global search-n-replace hunt).
Comment 5•19 years ago
|
||
Comment on attachment 203987 [details] [diff] [review] C API for nsTraceRefcnt r- to get this off my queue until questions are addressed.
Attachment #203987 -
Flags: review?(benjamin) → review-
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → Future
Comment 7•18 years ago
|
||
FIXED by bug 325229.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 8•18 years ago
|
||
Not fixed, since the macros still aren't usable.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 9•18 years ago
|
||
Note that this change is not just a change in delimiters: -// nsCOMPtr.h allows these macros to be defined by clients -// These logging functions require dynamic_cast<void *>, so we don't -// define these macros if we don't have dynamic_cast. +/* nsCOMPtr.h allows these macros to be defined by clients + * These logging functions require dynamic_cast<void*>, so they don't + * do anything useful if we don't have dynamic_cast<void*>. */ since bsmedberg didn't update this comment with his patch. (I'm not sure I like that change, either, but I suppose it's OK.)
Attachment #203987 -
Attachment is obsolete: true
Attachment #212013 -
Flags: review?(benjamin)
Updated•18 years ago
|
Attachment #212013 -
Flags: review?(benjamin) → review+
Assignee | ||
Comment 10•18 years ago
|
||
Fix checked in to trunk.
Status: REOPENED → RESOLVED
Closed: 18 years ago → 18 years ago
Resolution: --- → FIXED
Comment on attachment 203987 [details] [diff] [review] C API for nsTraceRefcnt I realize that a different fix went into the trunk but this patch has actually been very useful to us working on the 1.8 branch (for GC logging - bug 307312). Wondering what folks thought of putting it on the branch only.
Attachment #203987 -
Flags: approval1.8.1?
Assignee | ||
Comment 12•18 years ago
|
||
Comment on attachment 203987 [details] [diff] [review] C API for nsTraceRefcnt Minusing (just myself, not on behalf of drivers) since we don't want an API that doesn't match what we've added on the trunk, and also since the patch has review-.
Attachment #203987 -
Flags: approval1.8.1? → approval1.8.1-
You need to log in
before you can comment on or make changes to this bug.
Description
•