本文整理汇总了C++中JLocalEnv::CallStaticLongMethod方法的典型用法代码示例。如果您正苦于以下问题:C++ JLocalEnv::CallStaticLongMethod方法的具体用法?C++ JLocalEnv::CallStaticLongMethod怎么用?C++ JLocalEnv::CallStaticLongMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JLocalEnv
的用法示例。
在下文中一共展示了JLocalEnv::CallStaticLongMethod方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getRuntime
extern "C" VALUE
rb_thread_blocking_region(rb_blocking_function_t func, void* data, rb_unblock_function_t ub_func, void* data2)
{
JLocalEnv env;
jlong jret = env->CallStaticLongMethod(JRuby_class, JRuby_nativeBlockingRegion, getRuntime(),
p2j((void *)func), p2j(data),
p2j((void *)ub_func), p2j(data2));
checkExceptions(env);
return (VALUE)(j2p(jret));
}
示例2: valueToObject
extern "C" unsigned long
rb_big2ulong(VALUE obj)
{
if (TYPE(obj) == T_BIGNUM) {
JLocalEnv env;
jlong result = env->CallStaticLongMethod(RubyBignum_class, RubyBignum_big2ulong_method, valueToObject(env, obj));
checkExceptions(env);
return (unsigned long) result;
} else {
return (unsigned long) rb_big2ll(obj);
}
}
示例3: size
static VALUE
newString(const char* ptr, int len, int capacity = 0, bool tainted = false)
{
if (len < 0) {
rb_raise(rb_eArgError, "negative string size (or size too big)");
}
JLocalEnv env;
jbyteArray bytes = env->NewByteArray(capacity > len ? capacity : len);
checkExceptions(env);
if (len > 0 && ptr != NULL) {
env->SetByteArrayRegion(bytes, 0, len, (jbyte *) ptr);
checkExceptions(env);
}
jlong result = env->CallStaticLongMethod(JRuby_class, JRuby_newString, jruby::getRuntime(), bytes, (jint)len, (jboolean) tainted);
checkExceptions(env);
return (VALUE) result;
}
示例4: nsync
RString*
RubyString::toRString(bool readonly)
{
if (rwdata.rstring != NULL) {
if (readonly || !rwdata.readonly) {
return rwdata.rstring;
}
// Switch from readonly to read-write
rwdata.readonly = false;
TAILQ_INSERT_TAIL(&jruby::nsyncq, &rwdata.nsync, syncq);
JLocalEnv env;
nsync(env);
return rwdata.rstring;
}
JLocalEnv env;
rwdata.jsync.data = this;
rwdata.jsync.sync = RubyString_jsync;
rwdata.nsync.data = this;
rwdata.nsync.sync = RubyString_nsync;
rwdata.clean.data = this;
rwdata.clean.sync = RubyString_clean;
rwdata.rstring = (RString *) j2p(env->CallStaticLongMethod(JRuby_class, JRuby_getRString, obj));
checkExceptions(env);
rwdata.readonly = readonly;
TAILQ_INSERT_TAIL(&jruby::cleanq, &rwdata.clean, syncq);
TAILQ_INSERT_TAIL(&jruby::jsyncq, &rwdata.jsync, syncq);
if (!readonly) {
TAILQ_INSERT_TAIL(&jruby::nsyncq, &rwdata.nsync, syncq);
}
nsync(env);
return rwdata.rstring;
}
示例5: return
extern "C" VALUE
rb_class_of(VALUE obj)
{
JLocalEnv env;
return (VALUE) env->CallStaticLongMethod(JRuby_class, JRuby_getMetaClass, valueToObject(env, obj));
}