Closed Bug 1415454 Opened 7 years ago Closed 7 years ago

Miscellaneous code cleanups in mozjemalloc.cpp

Categories

(Core :: Memory Allocator, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(3 files, 1 obsolete file)

      No description provided.
Comment on attachment 8926281 [details]
Bug 1415454 - Remove the unused arena_bin_t* argument to arena_t::AllocRun.

https://reviewboard.mozilla.org/r/197552/#review202808


C/C++ static analysis found 0 defects in this patch.

You can run this analysis locally with: `./mach static-analysis check path/to/file.cpp`
Comment on attachment 8926281 [details]
Bug 1415454 - Remove the unused arena_bin_t* argument to arena_t::AllocRun.

https://reviewboard.mozilla.org/r/197552/#review202810


C/C++ static analysis found 0 defects in this patch.

You can run this analysis locally with: `./mach static-analysis check path/to/file.cpp`
Comment on attachment 8926285 [details]
Bug 1415454 - Replace RedBlackTree::Init with a constructor.

https://reviewboard.mozilla.org/r/197556/#review202812


C/C++ static analysis found 0 defects in this patch.

You can run this analysis locally with: `./mach static-analysis check path/to/file.cpp`
Attachment #8926285 - Attachment is obsolete: true
Attachment #8926285 - Flags: review?(n.nethercote)
(In reply to Mike Hommey [:glandium] from comment #4)
> Created attachment 8926285 [details]
> Bug 1415454 - Replace RedBlackTree::Init with a constructor.
> 
> Before 1412722, RedBlackTree actually needed a constructor to fill the
> sentinel, but now, all it contains is a pointer to a root node, and an
> empty tree just has a null root node. So we can use a constexpr
> constructor for the class, which in most cases removes the need for
> manual initialization/construction (being used as member of constructed
> classes, or globals), except in the case of arena_bin_t, which is never
> constructed.
> 
> Review commit: https://reviewboard.mozilla.org/r/197556/diff/#index_header
> See other reviews: https://reviewboard.mozilla.org/r/197556/

FWIW, this made gcc emit a static initializers for gArenas... to set mArenas.mRoot and mPrivateArenas.mRoot to null... except that's too late because other code has already called malloc before the static initializer runs, so it actually resets both trees...
Comment on attachment 8926281 [details]
Bug 1415454 - Remove the unused arena_bin_t* argument to arena_t::AllocRun.

https://reviewboard.mozilla.org/r/197552/#review203112
Attachment #8926281 - Flags: review?(n.nethercote) → review+
Comment on attachment 8926282 [details]
Bug 1415454 - Replace log2 lookup table with FloorLog2.

https://reviewboard.mozilla.org/r/197554/#review203116
Attachment #8926282 - Flags: review?(n.nethercote) → review+
Comment on attachment 8926280 [details]
Bug 1415454 - Inline MallocBinEasy and MallocBinHard.

https://reviewboard.mozilla.org/r/197550/#review203120
Attachment #8926280 - Flags: review?(n.nethercote) → review+
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/f64defe0d11e
Inline MallocBinEasy and MallocBinHard. r=njn
https://hg.mozilla.org/integration/autoland/rev/b8acdda17818
Remove the unused arena_bin_t* argument to arena_t::AllocRun. r=njn
https://hg.mozilla.org/integration/autoland/rev/bfa36a25eaf6
Replace log2 lookup table with FloorLog2. r=njn
https://hg.mozilla.org/mozilla-central/rev/f64defe0d11e
https://hg.mozilla.org/mozilla-central/rev/b8acdda17818
https://hg.mozilla.org/mozilla-central/rev/bfa36a25eaf6
Status: NEW → RESOLVED
Closed: 7 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: