|
|
|
|
|
by theamk
1936 days ago
|
|
My first reaction to this would be to change it to take as struct, but the ticket comments reveal why this is not a good idea: those are C++ functions called from Java, and Java's translation layer (JNI) does not support structs at all. It looks like the "recommended" case would be to create a new class, add a setter for each parameter, and pass it. But this is a lot of extra code, and many more function calls, which will slow down the program. If I were in their shoes, I would keep it as-is, but add an explanation comment. If this patter turns out to be both common and error-prone, I'd consider codegen which emits definition of C++ struct, Java caller and C++ receiver with matching parameter list. |
|