Closed Bug 1414073 Opened 8 years ago Closed 8 years ago

Rename arena_bin_t fields

Categories

(Core :: Memory Allocator, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: glandium, Assigned: glandium)

Details

Attachments

(1 file)

No description provided.
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+
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.
So let's morph this bug.
Summary: Remove arena_bin_t statistics → Rename arena_bin_t.runs
Summary: Rename arena_bin_t.runs → Rename arena_bin_t fields
Attachment #8924733 - Flags: review+ → review?(n.nethercote)
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+
(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"?
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: