[gjs] jsapi-util-string: Stop using g_mem_is_system_malloc()
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] jsapi-util-string: Stop using g_mem_is_system_malloc()
- Date: Thu, 10 Sep 2015 16:10:07 +0000 (UTC)
commit 5d480f519e2b7e95cf1fad2f9f1a8e798fd5fe49
Author: Colin Walters <walters verbum org>
Date: Thu Sep 10 12:09:32 2015 -0400
jsapi-util-string: Stop using g_mem_is_system_malloc()
It's now deprecated, if you want to change malloc, override the symbol
globally.
gjs/jsapi-util-string.cpp | 11 ++---------
1 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/gjs/jsapi-util-string.cpp b/gjs/jsapi-util-string.cpp
index 5ddc32d..b08d902 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]