Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 249e6c8c authored by Yang Ni's avatar Yang Ni Committed by Android Git Automerger
Browse files

am 02dff422: am 5db6f1fa: am 63dde9c8: Merge "Fix value size data type in closure creation."

* commit '02dff422':
  Fix value size data type in closure creation.
parents c09ccc56 02dff422
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ public class ScriptGroup2 extends BaseObj {
     */

    public static class Closure extends BaseObj {
        private Object[] mArgs;
        private Allocation mReturnValue;
        private Map<Script.FieldID, Object> mBindings;

@@ -76,8 +77,9 @@ public class ScriptGroup2 extends BaseObj {
                       Object[] args, Map<Script.FieldID, Object> globals) {
            super(0, rs);

            mArgs = args;
            mReturnValue = Allocation.createTyped(rs, returnType);
            mBindings = new HashMap<Script.FieldID, Object>();
            mBindings = globals;
            mGlobalFuture = new HashMap<Script.FieldID, Future>();

            int numValues = args.length + globals.size();
@@ -126,7 +128,8 @@ public class ScriptGroup2 extends BaseObj {
            super(0, rs);
            mFP = FieldPacker.createFieldPack(args);

            mBindings = new HashMap<Script.FieldID, Object>();
            mArgs = args;
            mBindings = globals;
            mGlobalFuture = new HashMap<Script.FieldID, Future>();

            int numValues = globals.size();
@@ -224,11 +227,13 @@ public class ScriptGroup2 extends BaseObj {
        }

        void setArg(int index, Object obj) {
            mArgs[index] = obj;
            ValueAndSize vs = new ValueAndSize(mRS, obj);
            mRS.nClosureSetArg(getID(mRS), index, vs.value, vs.size);
        }

        void setGlobal(Script.FieldID fieldID, Object obj) {
            mBindings.put(fieldID, obj);
            ValueAndSize vs = new ValueAndSize(mRS, obj);
            mRS.nClosureSetGlobal(getID(mRS), fieldID.getID(mRS), vs.value, vs.size);
        }
+2 −2
Original line number Diff line number Diff line
@@ -367,7 +367,7 @@ nClosureCreate(JNIEnv *_env, jobject _this, jlong con, jlong kernelID,
  return (jlong)(uintptr_t)rsClosureCreate(
      (RsContext)con, (RsScriptKernelID)kernelID, (RsAllocation)returnValue,
      fieldIDs, (size_t)fieldIDs_length, values, (size_t)values_length,
      (size_t*)sizes, (size_t)sizes_length,
      (int*)sizes, (size_t)sizes_length,
      depClosures, (size_t)depClosures_length,
      depFieldIDs, (size_t)depFieldIDs_length);
}
@@ -400,7 +400,7 @@ nInvokeClosureCreate(JNIEnv *_env, jobject _this, jlong con, jlong invokeID,
  return (jlong)(uintptr_t)rsInvokeClosureCreate(
      (RsContext)con, (RsScriptInvokeID)invokeID, jParams, jParamLength,
      fieldIDs, (size_t)fieldIDs_length, values, (size_t)values_length,
      (size_t*)sizes, (size_t)sizes_length);
      (int*)sizes, (size_t)sizes_length);
}

static void