On 03/02/2015 02:41 PM, Jeff Muizelaar wrote:
It looks like the current one should already be as the the AssignASCII
will be inlined into the caller and then the strlen can be inlined as
well.

Well AssignLiteral doesn't use strlen at all and that is the whole point of
AssignLiteral.
Can some template magic guarantee that if AssignASCII deals with literals too,
the strlen-less version is used when possible?



The original issue was
"The method name AssignLiteral can easily make people at the callee side
think it makes the string point to a piece of static data, which has no
runtime penalty. But this is false."
Can we somehow make use of nsDependentString easier? (not that I think it is 
hard. The name is just a bit long)



-Olli



-Jeff

On Sun, Mar 1, 2015 at 7:04 PM, smaug <sm...@welho.com> wrote:
On 03/02/2015 01:11 AM, Xidorn Quan wrote:

On Mon, Mar 2, 2015 at 9:50 AM, Boris Zbarsky <bzbar...@mit.edu> wrote:

On 3/1/15 5:04 PM, Xidorn Quan wrote:

Hence I think we should remove this method. All callees should use
either
AssignLiteral(MOZ_UTF16("some string")), or, if don't want to bloat the
binary, explicitly use AssignASCII("some string").


The latter requires an strlen() that AssignLiteral optimizes out, right?


Yes, so we can add another overload to AssignASCII which does this
optimization

How would you do that?

with less misleading.

- Xidorn


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

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

Reply via email to