Isn't it a good solution to exclude the method from being mapped in the 
metadata.xml and hand-write the code instead?
It certainly doesn't look all THAT difficult in this case.

Kind regards,
 
Willem Meints
Lead Developer
Professional Development Centre
 
mobile: +31 (0)6 47 506 037

-----Oorspronkelijk bericht-----
Van: monodroid-boun...@lists.ximian.com 
[mailto:monodroid-boun...@lists.ximian.com] Namens Jonathan Pryor
Verzonden: maandag 7 januari 2013 04:34
Aan: Discussions related to Mono for Android
Onderwerp: Re: [mono-android] Copying data between Dalvik and Mono... major 
slowdown.

On Jan 3, 2013, at 4:32 PM, Jeremy A. Kolb - ARA/NED <jk...@ara.com> wrote:
> Furthermore, In:
>  
>     [Register("bulkInsert", 
> "(Landroid/net/Uri;[Landroid/content/ContentValues;)I", "")]
>     public int BulkInsert(Android.Net.Uri url, ContentValues[] values)
>     {
>       IntPtr num1 = JNIEnv.NewArray<ContentValues>(values);
>       ...
>       if (values != null)
>       {
>         JNIEnv.CopyArray<ContentValues>(num1, values);
>         JNIEnv.DeleteLocalRef(num1);
>       }
>       return num2;
>     }
>  
> Why is the array copied back in after the function call? values shouldn't 
> have changed.

_You_ know that. The generator does not; it can change on a method-by-method 
basis, and the generator needs to generate code to support it.

>  url certainly doesn't get the same treatment.

`url` isn't an array, and thus has "pass by value" semantics.

For example, consider this potential Java method:

        public int bulkInsert(Uri url, ContentValues[] values) {
                url = new Url (...);
                values [0] = new ContentValues (...);
        }

The caller of `bulkInsert()` will _not_ be able to see that bulkInsert() 
modified `url`. That is _not_ true for `values[0]`; the caller _will_ be able 
to see the change performed to `values[0]`, were it to be changed.

 - Jon

_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Op dit e-mailbericht is de disclaimer van Info Support van toepassing, zie 
http://www.infosupport.com/disclaimer
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to