This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question on PushLocalFrame / EnsureLocalCapacity  RSS feed

Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a number of c++ functions that are called by the native method (i.e. the C++ function "JNI_CALL someClass_someMethod...") and have a large number of local refs created. So in each I have to call EnsureLocalCapacity and PushLocalFrame to make sure there's enough "space" for everything (can't call DeleteLocalRef because all the objects will be needed at the same time).

Since this EnsureLocal/PushLocal code (including error checks) is repeated in all these methods, I'd like to make a function that handles all that, e.g. ensureAndPush(int requiredCapacity). However, if I'm understanding it correctly, the calls will then only increase the local capacity within the "ensureCapacity" function and not in the functions that call it. Is this correct?

[ April 08, 2008: Message edited by: Dan Bizman ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!