ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Branko ─îibej <br...@apache.org>
Subject Re: Implementing Java -> platform callbacks in C++.
Date Thu, 04 Jun 2015 17:23:36 GMT
On 04.06.2015 18:49, Branko ─îibej wrote:
> On 04.06.2015 18:42, Atri Sharma wrote:
>> I like proxy objects although I am wondering if that makes copy by value
>> any more expensive (I am not sure about deep copying of non native objects)
> Note that the only data a proxy object contains is the Java reference --
> a pointer by the current JNI definition. What makes copying more
> expensive is the requirement to maintain a Java global reference in each
> copy. For this, you can either use JNI's NewGlobalRef/DeleteGlobalRef,
> or some kind of native reference counting in C++ -- effectively a shared
> pointer to a (wrapped) Java global reference. I have no ides what's
> faster, but I suspect that the letting JNI take care of reference
> handling is the better option.

Something like the attached prototype.

-- Brane

View raw message