On 10/5/14, 2:27 PM, Cameron Zwarich wrote:
I am opposed to anything that requires string copies between the DOM and JS

The only way to do that with SpiderMonkey in its current state is to use JSString for your string type. You cannot safely grab the chars from a SpiderMonkey string and hold that pointer across a GC operation, because the GC might move the string data in memory.

Gecko used to not copy the string on calls from JS to C++, and we had to give up on that and just copy.

Now for return values from C++ to JS we do still avoid the copy. But we also have the one-slot cache which is a big win; you should definitely do that no matter what else you do with return values...

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

Reply via email to