* commit '5db6f1fafa4990b2d583dcb407be361edc02019d': Fix value size data type in closure creation.
This commit is contained in:
@ -44,6 +44,7 @@ you will need approval.
|
||||
public class ScriptGroup2 extends BaseObj {
|
||||
|
||||
public static class Closure extends BaseObj {
|
||||
private Object[] mArgs;
|
||||
private Allocation mReturnValue;
|
||||
private Map<Script.FieldID, Object> mBindings;
|
||||
|
||||
@ -62,8 +63,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();
|
||||
@ -112,7 +114,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();
|
||||
@ -198,11 +201,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);
|
||||
}
|
||||
|
@ -372,7 +372,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);
|
||||
}
|
||||
@ -405,7 +405,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
|
||||
|
Reference in New Issue
Block a user