Closed Bug 1409273 Opened 7 years ago Closed 7 years ago

Replace malloc_mutex_* with class methods

Categories

(Core :: Memory Allocator, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(1 file)

This is preparatory work to later use RAII for mutexes.
Comment on attachment 8919171 [details]
Bug 1409273 - Replace malloc_mutex_* with class methods.

https://reviewboard.mozilla.org/r/190082/#review195328

r=me with the issue below fixed.

::: memory/build/mozjemalloc.cpp:3900
(Diff revision 1)
>    unsigned i;
>    arena_bin_t* bin;
>    size_t prev_run_size;
>  
> -  if (malloc_mutex_init(&mLock))
> +  if (mLock.Init())
>      return true;

You inverted the sense of Mutex::Init()'s return value so you need to invert this condition. And then you could likewise invert the sense of arena_t::Init()'s return value (and its call sites!)
Attachment #8919171 - Flags: review?(n.nethercote) → review+
I'll leave arena_t::Init for a followup.
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/2d93b4fb4b17
Replace malloc_mutex_* with class methods. r=njn
https://hg.mozilla.org/mozilla-central/rev/2d93b4fb4b17
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Blocks: 1411084
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: