Consider using `std::underlying_type_t` for the profiler buffer types
Categories
(Core :: Gecko Profiler, task, P3)
Tracking
()
People
(Reporter: canova, Assigned: aabh, Mentored)
References
Details
(Whiteboard: [fxp-profiler])
Attachments
(1 file)
Currently we have some types that we use in the buffer like ...UnderlyingType. It would be great to remove them and directly use std::underlying_type_t instead in the future.
See the locations where we have these types:
https://searchfox.org/mozilla-central/search?q=using.*UnderlyingType&path=profiler&case=false®exp=true
Updated•3 years ago
|
| Reporter | ||
Updated•3 years ago
|
Updated•3 years ago
|
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Comment 1•2 years ago
|
||
I'm not sure this transform is valid for the UnderlyingType in ProportionValue.h, as it isn't an enum class. We could potentially restructure it to make it so, but I don't know what value that would add as the typedef isn't used outside of ProportionValue.
| Reporter | ||
Comment 2•2 years ago
|
||
(In reply to Adam Brouwers-Harries [:aabh] [he/him] ⌚GMT from comment #1)
I'm not sure this transform is valid for the
UnderlyingTypeinProportionValue.h, as it isn't an enum class. We could potentially restructure it to make it so, but I don't know what value that would add as the typedef isn't used outside ofProportionValue.
Yes, you're right. I think when I wrote this bug and added this searchfox link, that type didn't exist yet. Let's leave that type out of this bug's scope.
| Assignee | ||
Comment 3•2 years ago
|
||
Sounds good. I'm mostly done with the refactoring, so should hopefully have a patch up today.
| Assignee | ||
Comment 4•2 years ago
|
||
This patch replaces "custom" underlying type definitions with definitions gleaned using the std::underlying_type mechanism. This allows us to directly set the underlying type for the enums without having to name it, and reduces the number of semantically identical names in the profile buffer code.
Comment 6•2 years ago
|
||
| bugherder | ||
Updated•2 years ago
|
Updated•7 days ago
|
Updated•7 days ago
|
Updated•7 days ago
|
Updated•7 days ago
|
Description
•