Closed
Bug 701210
Opened 13 years ago
Closed 13 years ago
nsTArray::SizeOf() should use malloc_usable_size
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla11
Tracking | Status | |
---|---|---|
firefox11 | --- | fixed |
People
(Reporter: justin.lebar+bug, Assigned: justin.lebar+bug)
References
Details
(Whiteboard: [MemShrink][qa-])
Attachments
(1 file)
1.92 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
// @return The amount of memory taken used by this nsTArray, not including
// sizeof(this)
size_t SizeOf() const {
return this->UsesAutoArrayBuffer() ?
0 : this->Capacity() * sizeof(elem_type) + sizeof(*this->Hdr());
}
This isn't as bad as it looks, because the capacity is chosen so that the capacity plus the header is a power of 2. But there can be a few bytes of slop in there, and a call to Compact() will mess this calculation up.
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → justin.lebar+bug
Assignee | ||
Comment 1•13 years ago
|
||
Attachment #573367 -
Flags: review?(roc)
Attachment #573367 -
Flags: review?(roc) → review+
Assignee | ||
Comment 2•13 years ago
|
||
status-firefox11:
--- → fixed
Comment 3•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
Updated•13 years ago
|
Whiteboard: [MemShrink]
Assignee | ||
Comment 4•13 years ago
|
||
OOC, does this show up as a +1/-1 in the weekly MemShrink report?
Comment 5•13 years ago
|
||
(In reply to Justin Lebar [:jlebar] from comment #4)
> OOC, does this show up as a +1/-1 in the weekly MemShrink report?
No. I record the open P1/P2/P3/U bug numbers each week, and diff with the previous week. A bug that's fixed in this timeframe won't be present in either snapshot, so it won't be counted.
You need to log in
before you can comment on or make changes to this bug.
Description
•