octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #48750] java interface: unboxing scalars: macr


From: Ernst Reissner
Subject: [Octave-bug-tracker] [bug #48750] java interface: unboxing scalars: macros and object creation
Date: Wed, 10 Aug 2016 14:45:40 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0

URL:
  <http://savannah.gnu.org/bugs/?48750>

                 Summary: java interface: unboxing scalars: macros and object
creation
                 Project: GNU Octave
            Submitted by: ernstreissner
            Submitted on: Wed 10 Aug 2016 02:45:37 PM GMT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

In ov-java.cc method 
static bool
unbox (JNIEnv *jni_env, const octave_value& val, jobject_ref& jobj,
       jclass_ref& jcls)

There is a macro for conversion of primitive scalars. 
This is in itself not so good. 
Also, the JVM is forced to create objects. 
If I have values 0 then each conversion creates a new one, 
putting load on the gc. 
It is bad style to do so. 
Instead of new Integer(0), write Integer.valueOf(0) 
and let the JVM decide whether to invoke a constructor or not. 






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48750>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]