Closed Bug 1448138 Opened 7 years ago Closed 7 years ago

rename DataFlags::SHARED to REFCOUNTED

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: dbaron, Assigned: dbaron)

Details

Attachments

(1 file)

Per IRC conversation in #developers this morning, I think it would be clearer if we renamed DataFlags::SHARED to REFCOUNTED. See starting at https://mozilla.logbot.info/developers/20180322#c14502459
I presumably need to separate out the changes in servo/ and make a servo PR, but let's start with all-in-one-patch for review. :-)
Comment on attachment 8961549 [details] [diff] [review] Rename string DataFlags::SHARED to REFCOUNTED to make it clearer to those reading the code Review of attachment 8961549 [details] [diff] [review]: ----------------------------------------------------------------- Thanks, that's definitely clearer. ::: servo/support/gecko/nsstring/src/lib.rs @@ -139,5 @@ > #[repr(C)] > pub struct DataFlags: u16 { > const TERMINATED = 1 << 0; // IsTerminated returns true > const VOIDED = 1 << 1; // IsVoid returns true > - const SHARED = 1 << 2; // mData points to a heap-allocated, shared buffer Maybe rephrase the comment to say "shareable ref counted buffer" or something to that effect ::: xpcom/string/nsTSubstring.cpp @@ +120,5 @@ > > // > // several cases: > // > + // (1) we have a shared buffer (this->mDataFlags & DataFlags::REFCOUNTED) Ditto on this comment. ::: xpcom/tests/gtest/TestTArray2.cpp @@ +627,5 @@ > do { \ > ASSERT_FALSE(IS_USING_AUTO(arr)); \ > } while(0) > > +#define CHECK_USES_REFCOUNTED_EMPTY_HDR(arr) \ This is unrelated to strings, it can be reverted.
Attachment #8961549 - Flags: review?(erahm) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/5b91410deb5b02599f99e67a615b613bf7b9971b Bug 1448138 - Rename string DataFlags::SHARED to REFCOUNTED to make it clearer to those reading the code. r=erahm
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Component: String → XPCOM
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: