Native calls and 16-slot local reference limit

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Native calls and 16-slot local reference limit

scgames2
According to documentation here and elsewhere, upon entering a native function JNI guarantees that 16 local reference slots are available. Android seems to provide much more than that, and I'm aware there are functions such as PushLocalFrame() available, but it's specifically the guaranteed minimum I'm interested in.

My question is, do reference arguments to native functions (the object/class argument, and any other arguments of object type) count against those 16 slots? For example, if a native function takes the usual object/class argument and a jstring argument, do you then only have 14 slots available?

My assumption is that function arguments don't count against the minimum. Almost all evidence I've seen seems to support that, as does a common-sense reading of the documentation, but I've also seen some sources that seem vague on this point, so I'd like to confirm it if possible.

Are function arguments counted against the 16 slots? Or are you guaranteed 16 slots irrespective of the function arguments?

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/289a202a-f6ea-4ac3-9c37-9715e613893e%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Native calls and 16-slot local reference limit

Dan Albert
+enh

On Tue, May 26, 2020, 07:54 scgames2 <[hidden email]> wrote:
According to documentation here and elsewhere, upon entering a native function JNI guarantees that 16 local reference slots are available. Android seems to provide much more than that, and I'm aware there are functions such as PushLocalFrame() available, but it's specifically the guaranteed minimum I'm interested in.

My question is, do reference arguments to native functions (the object/class argument, and any other arguments of object type) count against those 16 slots? For example, if a native function takes the usual object/class argument and a jstring argument, do you then only have 14 slots available?

My assumption is that function arguments don't count against the minimum. Almost all evidence I've seen seems to support that, as does a common-sense reading of the documentation, but I've also seen some sources that seem vague on this point, so I'd like to confirm it if possible.

Are function arguments counted against the 16 slots? Or are you guaranteed 16 slots irrespective of the function arguments?

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/289a202a-f6ea-4ac3-9c37-9715e613893e%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAFVaGhuQgamrNpiLfAZsRVK67FUkS%3D0RtLYuwnktjw_x3VqTwQ%40mail.gmail.com.
enh
Reply | Threaded
Open this post in threaded view
|

Re: Native calls and 16-slot local reference limit

enh
+Nicolas Geoffray because that code's probably been rewritten twice
since i last touched it!

On Tue, May 26, 2020 at 8:23 AM Dan Albert <[hidden email]> wrote:

>
> +enh
>
> On Tue, May 26, 2020, 07:54 scgames2 <[hidden email]> wrote:
>>
>> According to documentation here and elsewhere, upon entering a native function JNI guarantees that 16 local reference slots are available. Android seems to provide much more than that, and I'm aware there are functions such as PushLocalFrame() available, but it's specifically the guaranteed minimum I'm interested in.
>>
>> My question is, do reference arguments to native functions (the object/class argument, and any other arguments of object type) count against those 16 slots? For example, if a native function takes the usual object/class argument and a jstring argument, do you then only have 14 slots available?
>>
>> My assumption is that function arguments don't count against the minimum. Almost all evidence I've seen seems to support that, as does a common-sense reading of the documentation, but I've also seen some sources that seem vague on this point, so I'd like to confirm it if possible.
>>
>> Are function arguments counted against the 16 slots? Or are you guaranteed 16 slots irrespective of the function arguments?
>>
>> --
>> You received this message because you are subscribed to the Google Groups "android-ndk" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
>> To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/289a202a-f6ea-4ac3-9c37-9715e613893e%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAJgzZoocxkr89xCWJ6XnpTxOx%3Ddbc_DpfynU895HiJZj-ekrOw%40mail.gmail.com.