Rename arena_bin_t fields

RESOLVED FIXED in Firefox 58

Status

()

Core
Memory Allocator
RESOLVED FIXED
17 days ago
17 days ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

unspecified
mozilla58
Points:
---

Firefox Tracking Flags

(firefox58 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

Comment hidden (empty)
Comment hidden (mozreview-request)

Comment 2

17 days 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

17 days 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

17 days ago
So let's morph this bug.
Summary: Remove arena_bin_t statistics → Rename arena_bin_t.runs
(Assignee)

Updated

17 days ago
Summary: Rename arena_bin_t.runs → Rename arena_bin_t fields
Comment hidden (mozreview-request)
(Assignee)

Updated

17 days ago
Attachment #8924733 - Flags: review+ → review?(n.nethercote)

Comment 6

17 days 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

17 days 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)

Comment 9

17 days ago
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/e6d86b7284ba
Rename arena_bin_t fields. r=njn

Comment 10

17 days ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/e6d86b7284ba
Status: NEW → RESOLVED
Last Resolved: 17 days 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.