You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2018/08/06 17:53:39 UTC

[couchdb] branch add-chakra-support updated (5cc319f -> 7b125ef)

This is an automated email from the ASF dual-hosted git repository.

davisp pushed a change to branch add-chakra-support
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


    from 5cc319f  TMP - test stuff
     new 87f7b1e  Fix segfault on serialized resource reuse
     new 7b125ef  Fix out of stack space error.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 foo.es                                |  2 ++
 src/couch_chakra/src/couch_chakra.erl | 14 +++++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)
 mode change 100644 => 100755 foo.es


[couchdb] 01/02: Fix segfault on serialized resource reuse

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch add-chakra-support
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 87f7b1e1347d932c514e63111d76cda75160c1dd
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Mon Aug 6 12:50:16 2018 -0500

    Fix segfault on serialized resource reuse
---
 src/couch_chakra/src/couch_chakra.erl | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/couch_chakra/src/couch_chakra.erl b/src/couch_chakra/src/couch_chakra.erl
index b1af729..0c02033 100644
--- a/src/couch_chakra/src/couch_chakra.erl
+++ b/src/couch_chakra/src/couch_chakra.erl
@@ -269,9 +269,17 @@ create_ddoc_context(#st{runtime = Rt}, DDoc) ->
 
 
 load_script(Ctx, ScriptName) ->
-    {ok, Script} = get_priv_file(ScriptName),
-    BinScriptName = list_to_binary(ScriptName),
-    {ok, _} = chakra:eval(Ctx, Script, [{source_url, BinScriptName}]).
+    Code = case get(ScriptName) of
+        undefined ->
+            {ok, Script} = get_priv_file(ScriptName),
+            {ok, Serialized} = chakra:serialize(Ctx, Script),
+            put(ScriptName, Serialized),
+            Serialized;
+        Else ->
+            Else
+    end,
+    BinScriptName = iolist_to_binary(ScriptName),
+    {ok, _} = chakra:run(Ctx, Code, [{source_url, BinScriptName}]).
 
 
 get_priv_file(FileName) ->


[couchdb] 02/02: Fix out of stack space error.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch add-chakra-support
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 7b125ef2bb193f7f58941f144643f42da82f9b6e
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Mon Aug 6 12:53:20 2018 -0500

    Fix out of stack space error.
---
 foo.es | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/foo.es b/foo.es
old mode 100644
new mode 100755
index 22414e2..8b63bdd
--- a/foo.es
+++ b/foo.es
@@ -1,3 +1,5 @@
+#!/usr/bin/env escript
+%%! +sssdcpu 128
 
 main([]) ->
   %Prompt = io_lib:format("GDB Attach to: ~s~n", [os:getpid()]),