Closed Bug 1681546 Opened 4 years ago Closed 4 years ago

Rename the getters/setters of MOZ_ATOMIC_BITFIELDS

Categories

(Core :: MFBT, task)

task

Tracking

()

RESOLVED FIXED
85 Branch
Tracking Status
firefox85 --- fixed

People

(Reporter: Gankra, Assigned: Gankra)

Details

Attachments

(1 file)

While GetField/SetField are natural and minimal names, I've found they cause a lot of problems for types which, quite naturally, expose getters/setters for their fields. The names conflict, so the field needs to be renamed to "FieldPriv" or "FieldInternal" or whatever and it just makes everything extra muddy if you're using the "direct" setter or the hand-written one with potential checks and logging.

I think LoadField / StoreField will be suitable, with the added bonus that those names are more associated with "doing atomic stuff" (ime).

I was running into issues where these names would conflict with the type's own Get/Set methods
and these names have the added benefit of indicating a bit more than atomic stuff is going on.

Pushed by abeingessner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b0cedadb2b2a rename MOZ_ATOMIC_BITFIELDS methods to Load/Store. r=valentin,necko-reviewers
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: