Use RAII classes in base::SharedMemory
Categories
(Core :: IPC, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox83 | --- | fixed |
People
(Reporter: jld, Assigned: jld)
References
Details
Attachments
(2 files)
I have some cleanups for base::SharedMemory
in my topic branch for bug 1440203 that I'm breaking out into a separate bug:
-
Using
mozilla::UniqueFileHandle
instead of rawint
s/HANDLE
s. This makes it easier to avoid fd/handle leaks or double closes, which is useful given how freezing and memfd both increase the complexity of this code, and slightly reduces the per-platform code here. -
Changing the mapped memory to a
UniquePtr
instance, with a stateful deleter on POSIX platforms. This encapsulates some things that have caused problems in the past. More usefully, combined with the above change, this allows= default
ing the default and move constructors; in the past it's been too easy to forget to handle a new or changed field in one of them.
Assignee | ||
Comment 1•4 years ago
|
||
Assignee | ||
Comment 2•4 years ago
|
||
Pushed by jedavis@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3a2941fa7d4b Change IPC base::SharedMemory to use RAII for file descriptors/handles. r=nika https://hg.mozilla.org/integration/autoland/rev/f6527a1d0f14 Use RAII for the memory mapping in IPC base::SharedMemory, and default its constructors. r=nika
Comment 4•4 years ago
|
||
Backed out for Valgrind bustages.
Log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=317836923&repo=autoland&lineNumber=64229
Backout: https://hg.mozilla.org/integration/autoland/rev/007e30d27d93106dac27d9ca988cc58d2fd53863
Assignee | ||
Comment 5•4 years ago
|
||
Pushed by jedavis@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/08a6fb2b9100 Change IPC base::SharedMemory to use RAII for file descriptors/handles. r=nika https://hg.mozilla.org/integration/autoland/rev/ad1bd0312bcd Use RAII for the memory mapping in IPC base::SharedMemory, and default its constructors. r=nika
Comment 7•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/08a6fb2b9100
https://hg.mozilla.org/mozilla-central/rev/ad1bd0312bcd
Description
•