[gjs/wip/js24: 16/29] JS_EncodeStringToBuffer, add context as first argument. JS_NewRuntime add JS_NO_HELPER_THREADS flag



commit bc2e877d3b8e56413f74a01ad0356fd502d44c18
Author: Tim Lunn <tim feathertop org>
Date:   Sat Sep 28 11:13:21 2013 +1000

    JS_EncodeStringToBuffer, add context as first argument. JS_NewRuntime add JS_NO_HELPER_THREADS
    flag

 gjs/context.cpp           |    2 +-
 gjs/jsapi-util-string.cpp |    2 +-
 gjs/jsapi-util.cpp        |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gjs/context.cpp b/gjs/context.cpp
index 9942c92..ba4a787 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -564,7 +564,7 @@ gjs_context_constructor (GType                  type,
 
     js_context = GJS_CONTEXT(object);
 
-    js_context->runtime = JS_NewRuntime(32*1024*1024 /* max bytes */);
+    js_context->runtime = JS_NewRuntime(32*1024*1024 /* max bytes */, JS_NO_HELPER_THREADS);
     JS_SetNativeStackQuota(js_context->runtime, 1024*1024);
     if (js_context->runtime == NULL)
         g_error("Failed to create javascript runtime");
diff --git a/gjs/jsapi-util-string.cpp b/gjs/jsapi-util-string.cpp
index d4b96d0..af58564 100644
--- a/gjs/jsapi-util-string.cpp
+++ b/gjs/jsapi-util-string.cpp
@@ -56,7 +56,7 @@ gjs_string_to_utf8 (JSContext  *context,
 
     if (utf8_string_p) {
         bytes = (char*) g_malloc((len + 1) * sizeof(char));
-        JS_EncodeStringToBuffer(str, bytes, len);
+        JS_EncodeStringToBuffer(context, str, bytes, len);
         bytes[len] = '\0';
         *utf8_string_p = bytes;
     }
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index 67de0f3..98cf0a8 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -338,7 +338,7 @@ gjs_value_debug_string(JSContext      *context,
     size_t len = JS_GetStringEncodingLength(context, str);
     if (len != (size_t)(-1)) {
         bytes = (char*) g_malloc((len + 1) * sizeof(char));
-        JS_EncodeStringToBuffer(str, bytes, len);
+        JS_EncodeStringToBuffer(context, str, bytes, len);
         bytes[len] = '\0';
     } else {
         bytes = g_strdup("[invalid string]");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]