Closed
Bug 1414073
Opened 8 years ago
Closed 8 years ago
Rename arena_bin_t fields
Categories
(Core :: Memory Allocator, enhancement)
Core
Memory Allocator
Tracking
()
RESOLVED
FIXED
mozilla58
| Tracking | Status | |
|---|---|---|
| firefox58 | --- | fixed |
People
(Reporter: glandium, Assigned: glandium)
Details
Attachments
(1 file)
No description provided.
| Comment hidden (mozreview-request) |
Comment 2•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8924733 [details]
Bug 1414073 - Rename arena_bin_t fields.
https://reviewboard.mozilla.org/r/195962/#review201220
Cool. My experience with memory reporting is that maintained counters are error-prone and traversals are better.
Did you validate the new number by comparing it to the old one before you removed the old one?
Attachment #8924733 -
Flags: review?(n.nethercote) → review+
| Assignee | ||
Comment 3•8 years ago
|
||
Thank you for making me double check. Turns out I hadn't stress tested enough, and this actually breaks things, because "runs" is actually a bad field name: runs that are 100% full are not in there.
| Assignee | ||
Comment 4•8 years ago
|
||
So let's morph this bug.
Summary: Remove arena_bin_t statistics → Rename arena_bin_t.runs
| Assignee | ||
Updated•8 years ago
|
Summary: Rename arena_bin_t.runs → Rename arena_bin_t fields
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•8 years ago
|
Attachment #8924733 -
Flags: review+ → review?(n.nethercote)
Comment 6•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8924733 [details]
Bug 1414073 - Rename arena_bin_t fields.
https://reviewboard.mozilla.org/r/195962/#review201228
::: memory/build/mozjemalloc.cpp:816
(Diff revision 2)
> // objects packed well, and it can also help reduce the number of
> // almost-empty chunks.
> - RedBlackTree<arena_chunk_map_t, ArenaRunTreeTrait> runs;
> + RedBlackTree<arena_chunk_map_t, ArenaRunTreeTrait> mNonFullRuns;
>
> // Size of regions in a run for this bin's size class.
> - size_t reg_size;
> + size_t mSizeClass;
Is this name right? It doesn't match the comment.
::: memory/build/mozjemalloc.cpp:825
(Diff revision 2)
>
> // Total number of regions in a run for this bin's size class.
> - uint32_t nregs;
> + uint32_t mRunNumRegions;
>
> // Number of elements in a run's regs_mask for this bin's size class.
> - uint32_t regs_mask_nelms;
> + uint32_t mRunNumRegionsMask;
This comment needs changing?
::: memory/build/mozjemalloc.cpp:830
(Diff revision 2)
> - uint32_t regs_mask_nelms;
> + uint32_t mRunNumRegionsMask;
>
> // Offset of first region in a run for this bin's size class.
> - uint32_t reg0_offset;
> + uint32_t mRunFirstRegionOffset;
>
> - // Bin statistics.
> + // Current number of runs in this bin.
Is that both full and non-full runs?
Attachment #8924733 -
Flags: review?(n.nethercote) → review+
| Assignee | ||
Comment 7•8 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #6)
> Comment on attachment 8924733 [details]
> Bug 1414073 - Rename arena_bin_t fields.
>
> https://reviewboard.mozilla.org/r/195962/#review201228
>
> ::: memory/build/mozjemalloc.cpp:816
> (Diff revision 2)
> > // objects packed well, and it can also help reduce the number of
> > // almost-empty chunks.
> > - RedBlackTree<arena_chunk_map_t, ArenaRunTreeTrait> runs;
> > + RedBlackTree<arena_chunk_map_t, ArenaRunTreeTrait> mNonFullRuns;
> >
> > // Size of regions in a run for this bin's size class.
> > - size_t reg_size;
> > + size_t mSizeClass;
>
> Is this name right? It doesn't match the comment.
The comment is actually confusing. It's simply the size class. I'll change the comment.
> ::: memory/build/mozjemalloc.cpp:825
> (Diff revision 2)
> >
> > // Total number of regions in a run for this bin's size class.
> > - uint32_t nregs;
> > + uint32_t mRunNumRegions;
> >
> > // Number of elements in a run's regs_mask for this bin's size class.
> > - uint32_t regs_mask_nelms;
> > + uint32_t mRunNumRegionsMask;
>
> This comment needs changing?
The comment is actually good. The member name, not so great. Naming is hard :(
> ::: memory/build/mozjemalloc.cpp:830
> (Diff revision 2)
> > - uint32_t regs_mask_nelms;
> > + uint32_t mRunNumRegionsMask;
> >
> > // Offset of first region in a run for this bin's size class.
> > - uint32_t reg0_offset;
> > + uint32_t mRunFirstRegionOffset;
> >
> > - // Bin statistics.
> > + // Current number of runs in this bin.
>
> Is that both full and non-full runs?
Would "Current total number of runs" make it clearer? Or should I add "full and non-full"?
| Comment hidden (mozreview-request) |
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/e6d86b7284ba
Rename arena_bin_t fields. r=njn
Comment 10•8 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in
before you can comment on or make changes to this bug.
Description
•