jcpalmer
unread,Jun 23, 2011, 9:51:21 AM6/23/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to NativeLibs4Java
Olivier,
Being that Java 7 is close, and JavaCL uses external resources, you
might look into some minor changes for 1.0 that make using Automatic
Resource Management easy to switch to.
FYI, my impression of ARM's improvement over finalize() is: finalize()
called at garbage collection (irrelevant timing for external
resources) & can also be ignored by Java implementations. Tried to
find a good link, but failed. Guess I'll have to rely on my limit
knowledge.
ARM is based around the new interface Disposable, which has the
method: public void dispose(). You might implement your own clone of
the Disposable interface, & import it where needed.
Then put the code ,currently in your finalize(), in dispose() & call
dispose() from finalize(). For a Java 7 build have your Disposable
extend Java 7's.
Just something to think about.
Jeff