summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2015-09-10 12:09:32 -0400
committerColin Walters <walters@verbum.org>2015-09-10 12:09:32 -0400
commit5d480f519e2b7e95cf1fad2f9f1a8e798fd5fe49 (patch)
treeb90921e4db07b76eec3ac7d233e078f87574a0eb
parentc371c5ab6e55d72b083ade41a55f06ae51072e3e (diff)
downloadgjs-5d480f519e2b7e95cf1fad2f9f1a8e798fd5fe49.tar.gz
jsapi-util-string: Stop using g_mem_is_system_malloc()
It's now deprecated, if you want to change malloc, override the symbol globally.
-rw-r--r--gjs/jsapi-util-string.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/gjs/jsapi-util-string.cpp b/gjs/jsapi-util-string.cpp
index 5ddc32db..b08d902f 100644
--- a/gjs/jsapi-util-string.cpp
+++ b/gjs/jsapi-util-string.cpp
@@ -96,15 +96,8 @@ gjs_string_from_utf8(JSContext *context,
JS_BeginRequest(context);
- if (g_mem_is_system_malloc()) {
- /* Avoid a copy - assumes that g_malloc == js_malloc == malloc */
- str = JS_NewUCString(context, u16_string, u16_string_length);
- } else {
- str = JS_NewUCStringCopyN(context,
- (jschar*)u16_string,
- u16_string_length);
- g_free(u16_string);
- }
+ /* Avoid a copy - assumes that g_malloc == js_malloc == malloc */
+ str = JS_NewUCString(context, u16_string, u16_string_length);
if (str && value_p)
*value_p = STRING_TO_JSVAL(str);