On 05.10.2020 5:17, Nathan Hartman wrote:
While reviewing r1882115, I wondered what was the original rationale
for the C++ function SVNBase::createCppBoundObject() to cache clazz's
ctor's method ID in a locally scoped static variable.

It seems to be the common code style in JavaHL to cache the result of 'GetMethodID()'. I can also understand a performance rationale behind it.

In r846137 (the first commit of javaHL), I counted 11 cached results of 'GetMethodID()' and 2 uncached. From 2 uncached, 'JNIStackElement::JNIStackElement()' was silently changed to be cached in r850284.

So I think that the error I fixed was a result of mechanically copy&pasting code and not noticing that it shall not be cached in this specific function.

Reply via email to