Hello, how is it going?
Tor Lillqvist
tml at iki.fi
Fri Jun 1 02:25:59 PDT 2012
>> Yep. One complication is that I don't want to write the same code,
>> basically, twice: once in Java for Android and once in C++ for iOS
>> (and potential other software on other platforms where one would want
>> to use LO code to load documents and render pages into bitmaps). So
>> need to come up with some suitable way to share code.
>
>
> In that case, I would have thought that the DocumentLoader code should be
> implemented in C++ and called via the JNI.
Tue, but I am afraid then we would have to manually manage the
lifetime of C++ objects and have separate JNI functions to deallocate
them; the nice thing when doing UNO calls from Java is that the
UNO-wrapped C++ objects get handled like normal Java objects and just
becoming unreachable means they will get GCed eventually, and the
finalization that precedes being GCed trickles down as destruction on
the C++ side.
Still if one considers that we will be playing with significantly
large bitmap buffers, maybe manually deallocating them is not that
bad, then we can deallocate such a buffer with certainty right when we
know it isn't needed. On the other hand, that also then means that we
can forget to deallocate, and then leaks are much more bad, or
deallocate too early, etc etc all the usual heap corruption that one
lacks in a GCed environment;)
> Yeah sounds like we're at a similar level. I wouldn't say I've used it "for
> real" I've used it for some university assignments which is quite different.
> I should say that most of the coding I've done has been on PCs not android
> but I don't envisage much of a problem given what we intend to do is
> (graphics-wise) quite straightforward (famout last words...)
--tml
More information about the LibreOffice
mailing list