On Tuesday, January 29, 2019 at 12:22:08 AM UTC+5:30, Kris Maglione wrote:
> >Is it possible to add an  extra variable to mozilla string(nsTStringRepr).
> >
> >
> >I added a bool variable to nsTStringRepr class in  Xpcom/Strings/
> 
> As something of a side note, the general way to do this is to 
> add a new data or class flag, and store it in one of the 
> existing fields:
>

I think storing in existing fields will break the actual usage/functioning of 
those fields and it will make  more complex.  So I felt like adding a new flag 
will not affect normal functioning of it.

 
> https://searchfox.org/mozilla-central/rev/5c8ea961d04767db723a0a15e3a8f7fbca154129/xpcom/string/nsTStringRepr.h#300-301
> 
> Changing the size or layout of the string class is more or less 
> guaranteed to cause problems. Aside from affecting the size and 
> padding of thousands of classes, the strings API is some of the 
> oldest code in Gecko, and there is almost certainly some subtle 
> code which makes assumptions about its layout, and will break if 
> it changes. The Rust bindings are one such example (as you saw), 
> but there are almost certainly others as well.

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to