Closed Bug 1984011 Opened 11 months ago Closed 9 months ago

Use more constant initalisation in mozjemalloc

Categories

(Core :: Memory Allocator, task)

task

Tracking

()

RESOLVED FIXED
146 Branch
Tracking Status
firefox146 --- fixed

People

(Reporter: pbone, Assigned: pbone)

References

Details

Attachments

(8 files)

While I was working on something else I found that it was useful to give more mozjemalloc classes constexpr constructors so that they didn't need runtime initialisation.

On windows Mutex still needs its Init method called before it can be
used - it's constructor won't fully initalise it.

Attachment #9509060 - Attachment description: WIP: Bug 1984011 - pt 5. Give AddressRadixTree a constexpr constructor → Bug 1984011 - pt 5. Give AddressRadixTree a constexpr constructor r=glandium
Attachment #9509061 - Attachment description: WIP: Bug 1984011 - pt 6. Give ArenaCollection a constexpr constructor → Bug 1984011 - pt 6. Give ArenaCollection a constexpr constructor r=glandium
Attachment #9509062 - Attachment description: WIP: Bug 1984011 - pt 7. Add assertions to Mutex's initialisation → Bug 1984011 - pt 7. Add assertions to Mutex's initialisation r=glandium

Use more:

  • initialisers in the class definition,
  • initialiser lists in the constructor and
  • default constructors for class members
    so that code can be removed from the body of the constructor.
See Also: → 1991374
Attachment #9509056 - Attachment description: Bug 1984011 - pt 1. Make DoublyLinkedList's constructor is constexpr r=glandium → Bug 1984011 - pt 1. Make DoublyLinkedList's constructor constexpr r=glandium
Pushed by pbone@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/730dfc3c12b6 https://hg.mozilla.org/integration/autoland/rev/b47dcaccd94e pt 1. Make DoublyLinkedList's constructor constexpr r=glandium https://github.com/mozilla-firefox/firefox/commit/08a04985b811 https://hg.mozilla.org/integration/autoland/rev/fecd5523c09e pt 2. Make RedBlackTree's constructor constexpr r=glandium https://github.com/mozilla-firefox/firefox/commit/201ebb959d5c https://hg.mozilla.org/integration/autoland/rev/09e881d4a54f pt 3. Make StaticMutex's constructor constexpr r=glandium https://github.com/mozilla-firefox/firefox/commit/bc281b7f56d8 https://hg.mozilla.org/integration/autoland/rev/5b9b9808143d pt 4. Mutex now has a constexpr constructor on all platforms r=glandium https://github.com/mozilla-firefox/firefox/commit/acf68cbd78a4 https://hg.mozilla.org/integration/autoland/rev/9c04c98d079f pt 5. Give AddressRadixTree a constexpr constructor r=glandium https://github.com/mozilla-firefox/firefox/commit/649b1ba94934 https://hg.mozilla.org/integration/autoland/rev/c25285547a5b pt 6. Give ArenaCollection a constexpr constructor r=glandium https://github.com/mozilla-firefox/firefox/commit/6f863d55e907 https://hg.mozilla.org/integration/autoland/rev/66d3356412f1 pt 7. Add assertions to Mutex's initialisation r=glandium https://github.com/mozilla-firefox/firefox/commit/2eb99af37475 https://hg.mozilla.org/integration/autoland/rev/af20cca0645a pt 8. Simplify the arena_t constructor r=glandium
QA Whiteboard: [qa-triage-done-c147/b146]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: