Closed Bug 1451658 Opened 3 years ago Closed 3 years ago
_STATIC _CLASS annotation
It would be nice to have a MOZ_STATIC_CLASS annotation, indicating that objects of a class should only be instantiated in static memory. Nika says: > there is an attribute which requires that a class is used only in statics, > which is __attribute__((annotate("moz_global_class"))) > > This is currently exposed with a macro as MOZ_ONLY_USED_TO_AVOID_STATIC_CONSTRUCTORS: > https://searchfox.org/mozilla-central/rev/57bbc1ac58816dc054df242948f3ecf75e12df5f/mfbt/Attributes.h#675-681, > though we should probably also have a MOZ_STATIC_CLASS alias. Once that's done, this XXX item should be fixed: https://searchfox.org/mozilla-central/rev/57bbc1ac58816dc054df242948f3ecf75e12df5f/js/public/Class.h#617
Comment on attachment 8966513 [details] Bug 1451658 - Add MOZ_STATIC_CLASS. https://reviewboard.mozilla.org/r/235236/#review241008
Attachment #8966513 - Flags: review?(nika) → review+
Comment on attachment 8966514 [details] Bug 1451658 - Remove JS_STATIC_CLASS in favour of MOZ_STATIC_CLASS. https://reviewboard.mozilla.org/r/235238/#review241010
Attachment #8966514 - Flags: review?(nika) → review+
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/4ce7bb67eab9 Add MOZ_STATIC_CLASS. r=mystor https://hg.mozilla.org/integration/mozilla-inbound/rev/8c6cf2dab2ae Remove JS_STATIC_CLASS in favour of MOZ_STATIC_CLASS. r=mystor
BTW, I did a try push where I used a MOZ_STATIC_CLASS as a heap class and a stack class and it successfully complained about both.
You need to log in before you can comment on or make changes to this bug.