Closed
Bug 674284
Opened 12 years ago
Closed 12 years ago
Add nsTArray::SizeOf
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
mozilla8
People
(Reporter: khuey, Assigned: khuey)
Details
(Whiteboard: [MemShrink])
Attachments
(1 file)
794 bytes,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
For about:memory reporting usage.
Attachment #548525 -
Flags: review?(benjamin)
Updated•12 years ago
|
Attachment #548525 -
Flags: review?(benjamin) → review+
Assignee | ||
Comment 1•12 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/030c419226ed
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
Comment 2•12 years ago
|
||
this has been backed out http://hg.mozilla.org/mozilla-central/rev/9517e7652dec
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Updated•12 years ago
|
Whiteboard: [MemShrink]
Comment 3•12 years ago
|
||
Comment on attachment 548525 [details] [diff] [review] Patch >+ // @return The amount of memory taken used by this nsTArray, not including >+ // sizeof(this) >+ size_t SizeOf() const { >+ return Capacity() * sizeof(elem_type) + sizeof(mHdr); Except the mHdr is shared between non-auto nsTArrays...
Assignee | ||
Comment 4•12 years ago
|
||
(In reply to comment #3) > Comment on attachment 548525 [details] [diff] [review] [diff] [details] [review] > Patch > > >+ // @return The amount of memory taken used by this nsTArray, not including > >+ // sizeof(this) > >+ size_t SizeOf() const { > >+ return Capacity() * sizeof(elem_type) + sizeof(mHdr); > Except the mHdr is shared between non-auto nsTArrays... That's only true if the nsTArray is empty, no?
Assignee | ||
Comment 5•12 years ago
|
||
Comment on attachment 548525 [details] [diff] [review] Patch This bounced with ../../../dist/include/nsTArray.h: In member function 'size_t nsTArray<E, Alloc>::SizeOf() const': ../../../dist/include/nsTArray.h:436:21: error: there are no arguments to 'Capacity' that depend on a template parameter, so a declaration of 'Capacity' must be available ../../../dist/include/nsTArray.h:436:21: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) ../../../dist/include/nsTArray.h:436:52: error: 'mHdr' was not declared in this scope Not quite sure what to make of these ... it looks like base class members aren't in scope?
Comment 6•12 years ago
|
||
You need this->Capacity. Bare names are not in scope in template classes that inherit from other templated classes. C++ is weird like that.
Assignee | ||
Comment 7•12 years ago
|
||
Added the 'this' qualifiers. http://hg.mozilla.org/mozilla-central/rev/bd93ca20e1fd
Assignee: nobody → khuey
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•