Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: compiled/bindings/runtime_utils.cpp

Issue 29434561: Noissue - [emscripten] Call the correct constructor for strings created from JavaScript (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Added comment Created Aug. 23, 2017, 10:26 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « compiled/bindings/generator.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiled/bindings/runtime_utils.cpp
===================================================================
--- a/compiled/bindings/runtime_utils.cpp
+++ b/compiled/bindings/runtime_utils.cpp
@@ -7,16 +7,23 @@ extern "C"
void BINDINGS_EXPORTED InitString(DependentString* str,
String::value_type* data, String::size_type len)
{
// String is already allocated on stack, we merely need to call
// constructor.
new (str) DependentString(data, len);
}
+ void BINDINGS_EXPORTED InitOwnedString(OwnedString* str)
+ {
+ // String is already allocated on stack, we merely need to call
+ // constructor.
+ new (str) OwnedString();
+ }
+
void BINDINGS_EXPORTED DestroyString(OwnedString* str)
{
// Stack memory will be freed automatically, we need to call
// destructor explicitly however.
str->~OwnedString();
}
String::size_type BINDINGS_EXPORTED GetStringLength(
« no previous file with comments | « compiled/bindings/generator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld