EmilyMatt opened a new issue, #2637:
URL: https://github.com/apache/datafusion-comet/issues/2637

   ### What is the problem the feature request solves?
   
   Passing a paramter of `jobject` type to a JNI function is always followed by 
a JObject::from_raw(obj) call in our codebase.
   However this from_raw call is a completely empty operation, since all it 
does is bind a PhantomData object with a new lifetime 'local
   ```
   impl<'local> JObject<'local> {
       pub unsafe fn from_raw(raw: jobject) -> Self {
           Self {
               internal: raw,
               lifetime: PhantomData,
           }
       }
   }
   ```
   
   If we were to change the function signature to accept a JObject directly, 
said object would already receive the lifetime of the boundary function itself, 
as this is what the Rust compiler does when lifetime parameters are passed to 
boundary functions.
   
   ### Describe the potential solution
   
   Removing all the from_raw calls and usage of raw jni objects, except for 
when returning from JNI calls, as the returned object must not have a lifetime.
   
   ### Additional context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to