diff --git a/Src/Libraries/AotSubclasses.Generated.cs b/Src/Libraries/AotSubclasses.Generated.cs
index d808d8ec6..9381b53ea 100644
--- a/Src/Libraries/AotSubclasses.Generated.cs
+++ b/Src/Libraries/AotSubclasses.Generated.cs
@@ -1296,6 +1296,11 @@ public IronRuby_StandardLibrary_Digest_Digest_Base_Subclass(global::IronRuby.Bui
_immediateClass = rubyClass;
}
+ public IronRuby_StandardLibrary_Digest_Digest_Base_Subclass(global::IronRuby.Builtins.RubyClass/*!*/ rubyClass)
+ : base(rubyClass) {
+ _immediateClass = rubyClass;
+ }
+
public RubyClass/*!*/ ImmediateClass { get { return _immediateClass; } set { _immediateClass = value; } }
public RubyInstanceData TryGetInstanceData() { return _instanceData; }
public RubyInstanceData/*!*/ GetInstanceData() { return RubyOps.GetInstanceData(ref _instanceData); }
diff --git a/Src/Libraries/Builtins/ObjectSpace.cs b/Src/Libraries/Builtins/ObjectSpace.cs
index a69922d2f..018dcfef8 100644
--- a/Src/Libraries/Builtins/ObjectSpace.cs
+++ b/Src/Libraries/Builtins/ObjectSpace.cs
@@ -23,14 +23,6 @@
using System.Runtime.CompilerServices;
namespace IronRuby.Builtins {
- ///
- /// What a C extension's rb_data_type_t.dsize function reports: the bytes an object holds
- /// outside its slot. ObjectSpace.memsize_of adds it to the slot, as MRI does.
- ///
- internal interface IMemorySized {
- long ExtraMemorySize { get; }
- }
-
[RubyModule("ObjectSpace")]
public static class ObjectSpace {
#region define_finalizer, undefine_finalizer
diff --git a/Src/Libraries/Digest/Digest.cs b/Src/Libraries/Digest/Digest.cs
index d8bd5e91f..3262d0206 100644
--- a/Src/Libraries/Digest/Digest.cs
+++ b/Src/Libraries/Digest/Digest.cs
@@ -17,6 +17,7 @@
using System.Security.Cryptography;
using IronRuby.Builtins;
using IronRuby.Runtime;
+using IronRuby.Runtime.CApi;
using Microsoft.Scripting.Runtime;
using Microsoft.Scripting.Utils;
@@ -96,6 +97,9 @@ public class Base : Class {
private IncrementalHash _incremental;
+ // A hash function a C extension brings (ruby/digest.h): everything goes to it instead.
+ private readonly NativeDigest _native;
+
protected Base(HashAlgorithm/*!*/ algorithm, int blockLength) {
Assert.NotNull(algorithm);
_algorithm = algorithm;
@@ -103,6 +107,29 @@ protected Base(HashAlgorithm/*!*/ algorithm, int blockLength) {
_blockLength = blockLength;
}
+ ///
+ /// A subclass defined in Ruby, which only a C extension's digest plugin is: it sets the
+ /// class's "metadata" to its rb_digest_metadata_t, and the new object's context starts
+ /// initialized, as digest.so's allocator leaves it.
+ ///
+ protected Base(RubyClass/*!*/ cls) {
+ object metadata = null;
+ RubyClass owner = cls;
+ while (owner != null && !cls.Context.TryGetInstanceVariable(owner, "metadata", out metadata)) {
+ owner = owner.SuperClass;
+ }
+ if (owner == null) {
+ throw RubyExceptions.CreateRuntimeError("Digest::Base cannot be directly inherited in Ruby");
+ }
+ _native = NativeDigest.TryCreate(metadata);
+ if (_native == null) {
+ throw RubyExceptions.CreateTypeError(String.Format("wrong argument type {0} (expected digest/metadata)",
+ cls.Context.GetClassDisplayName(metadata)));
+ }
+ _digestLength = _native.DigestLength;
+ _blockLength = _native.BlockLength;
+ }
+
private protected Base(HashAlgorithmName algorithmName, Func/*!*/ hashData, int digestLength, int blockLength) {
Assert.NotNull(hashData);
_algorithmName = algorithmName;
@@ -131,6 +158,10 @@ public static int DigestLength(Base/*!*/ self) {
[RubyMethod("<<")]
[RubyMethod("update")]
public static Base/*!*/ Update(RubyContext/*!*/ context, Base/*!*/ self, [DefaultProtocol, NotNull]MutableString/*!*/ str) {
+ if (self._native != null) {
+ self._native.Update(str.ToByteArray());
+ return self;
+ }
self.Append(str.ToByteArray());
return self;
}
@@ -176,6 +207,13 @@ private void Append(byte[]/*!*/ data) {
///
[RubyMethod("initialize_copy", RubyMethodAttributes.PrivateInstance)]
public static Base/*!*/ InitializeCopy(Base/*!*/ self, [NotNull]Base/*!*/ other) {
+ if (self._native != null || other._native != null) {
+ if (self._native == null || other._native == null) {
+ throw RubyExceptions.CreateTypeError("different algorithms");
+ }
+ self._native.CopyFrom(other._native);
+ return self;
+ }
self.Clear();
self._buffer = other._buffer.AsSpan(0, other._count).ToArray();
self._count = other._count;
@@ -187,11 +225,18 @@ private void Append(byte[]/*!*/ data) {
[RubyMethod("finish", RubyMethodAttributes.PrivateInstance)]
public static MutableString/*!*/ Finish(RubyContext/*!*/ context, Base/*!*/ self) {
+ if (self._native != null) {
+ return MutableString.CreateBinary(self._native.Finish());
+ }
return MutableString.CreateBinary(self.GetCurrentHash());
}
[RubyMethod("reset")]
public static Base/*!*/ Reset(RubyContext/*!*/ context, Base/*!*/ self) {
+ if (self._native != null) {
+ self._native.Reset();
+ return self;
+ }
self.Clear();
if (self._algorithm != null) {
self._algorithm.Initialize();
@@ -216,7 +261,7 @@ private void Clear() {
///
internal static bool CanSnapshot(RubyContext/*!*/ context, object obj) {
var digest = obj as Base;
- if (digest == null) {
+ if (digest == null || digest._native != null) {
return false;
}
RubyClass cls = context.GetImmediateClassOf(obj);
diff --git a/Src/Ruby/Builtins/IMemorySized.cs b/Src/Ruby/Builtins/IMemorySized.cs
new file mode 100644
index 000000000..bdfb402ce
--- /dev/null
+++ b/Src/Ruby/Builtins/IMemorySized.cs
@@ -0,0 +1,16 @@
+/* ****************************************************************************
+ *
+ * This source code is subject to terms and conditions of the Apache License, Version 2.0. A
+ * copy of the license can be found in the License.html file at the root of this distribution.
+ *
+ * ***************************************************************************/
+
+namespace IronRuby.Builtins {
+ ///
+ /// The bytes an object holds outside its slot, as a C extension's rb_data_type_t.dsize function
+ /// reports them. ObjectSpace.memsize_of adds it to the slot, as MRI does.
+ ///
+ public interface IMemorySized {
+ long ExtraMemorySize { get; }
+ }
+}
diff --git a/Src/Ruby/CApi/CApi.Calls.cs b/Src/Ruby/CApi/CApi.Calls.cs
index 43d0bc2d2..5e290359d 100644
--- a/Src/Ruby/CApi/CApi.Calls.cs
+++ b/Src/Ruby/CApi/CApi.Calls.cs
@@ -126,7 +126,11 @@ internal static object InvokeMethod(CMethod/*!*/ method, RubyScope/*!*/ scope, o
argv[i] = ToValue(args[i]);
}
result = CallMethod(method.Function, method.Arity, selfValue, argc, argv);
+ for (int i = 0; i < argc; i++) {
+ SyncRawFreeze(argv[i]);
+ }
}
+ SyncRawFreeze(selfValue);
return FromValue(result);
} catch (CBlockBreak b) when (b.Bfc == frame.Bfc && frame.Bfc != null) {
return b.ReturnValue;
@@ -299,9 +303,18 @@ internal static object SendWith(bool publicOnly, object target, string/*!*/ name
// caller's frame - $~ by Regexp#match, $_ by gets - is the Ruby frame that called the C
// method, as in CRuby (the svar of the nearest Ruby-level frame).
RubyScope scope = (_frame != null ? _frame.Scope : null) ?? _context.EmptyScope;
+ if (name == "binding" && _frame != null && IsKernelBinding(target)) {
+ // Kernel#binding would capture the frame of the C method's caller
+ throw RubyExceptions.CreateRuntimeError("Can't create Binding from C level function");
+ }
return site.Target(site, scope, target, block, new RubyArray(args));
}
+ private static bool IsKernelBinding(object target) {
+ var method = _context.ResolveMethod(target, "binding", VisibilityContext.AllVisible).Info;
+ return method != null && method.DeclaringModule == _context.KernelModule;
+ }
+
private static Proc TakePassedBlock() {
var block = _passedBlock;
_passedBlock = null;
@@ -531,9 +544,16 @@ internal static void rb_iter_break() {
internal static void rb_iter_break_value(VALUE val) {
if (_cBlockDepth == 0) {
- // a break out of a Ruby block from C called inside it: IronRuby's break needs the
- // block's own frame, which a C function is not given
- throw RubyExceptions.CreateNotImplementedError("rb_iter_break outside a block written in C is not implemented by IronRuby's C API yet");
+ // called from a Ruby block: break out of the innermost one around the call, as a
+ // break in eval'd code does (CRuby's rb_iter_break unwinds to the block's caller)
+ RubyBlockScope blockScope;
+ RubyMethodScope methodScope;
+ (_frame?.Scope ?? _context.EmptyScope).GetInnerMostBlockOrMethodScope(out blockScope, out methodScope);
+ if (blockScope == null) {
+ throw new LocalJumpError("break from proc-closure", "break", FromValue(val));
+ }
+ var proc = blockScope.BlockFlowControl.Proc;
+ throw new EvalUnwinder(BlockReturnReason.Break, proc.Converter, proc.Kind, FromValue(val));
}
throw new CIterBreak(FromValue(val));
}
diff --git a/Src/Ruby/CApi/CApi.Debug.cs b/Src/Ruby/CApi/CApi.Debug.cs
new file mode 100644
index 000000000..5c8f3bf01
--- /dev/null
+++ b/Src/Ruby/CApi/CApi.Debug.cs
@@ -0,0 +1,242 @@
+/* ****************************************************************************
+ *
+ * This source code is subject to terms and conditions of the Apache License, Version 2.0. A
+ * copy of the license can be found in the License.html file at the root of this distribution.
+ *
+ * ***************************************************************************/
+
+using System;
+using System.Runtime.InteropServices;
+using IronRuby.Builtins;
+using VALUE = System.UInt64;
+
+namespace IronRuby.Runtime.CApi {
+ ///
+ /// ruby/debug.h: TracePoints with a C hook, the trace argument readers, and the debug
+ /// inspector. ObjectSpace.memsize_of's call into a typed object's dsize function too.
+ ///
+ internal static unsafe partial class CApi {
+
+ #region TracePoint
+
+ private static delegate* unmanaged[Cdecl] _callTracepoint;
+
+ // MRI's RUBY_EVENT_* bits, which TraceEvents shares; the names in bit order, as TracePoint#event
+ private static readonly string[] _traceEventNames = {
+ "line", "class", "end", "call", "return", "c_call", "c_return", "raise",
+ "b_call", "b_return", "thread_begin", "thread_end", "fiber_switch", "script_compiled", "rescue"
+ };
+
+ // The hook is func(tpval, data). target_thread is not supported by CRuby either (the
+ // parameter is named target_thread_not_supported_yet): it traces every thread.
+ internal static VALUE rb_tracepoint_new(VALUE target_thread, uint events, IntPtr func, void* data) {
+ if (_callTracepoint == null) {
+ _callTracepoint = (delegate* unmanaged[Cdecl])ShimExport("rb_ir_call_tracepoint");
+ }
+ var handler = Proc.Create(_context, 0, new Func((b, self, unused, args) => {
+ int raised;
+ var depth = EnterNative();
+ try {
+ _callTracepoint((void*)func, ToValue(args.Count > 0 ? args[0] : null), data, &raised);
+ } finally {
+ LeaveNative(depth);
+ }
+ if (raised != 0) {
+ Rethrow();
+ }
+ return null;
+ }));
+ return ToValue(new TracePoint(_context, (TraceEvents)(events & (uint)TraceEvents.All), handler));
+ }
+
+ private static TracePoint/*!*/ ToTracePoint(VALUE tpval) {
+ var tp = FromValue(tpval) as TracePoint;
+ if (tp == null) {
+ throw RubyExceptions.CreateTypeError(String.Format("wrong argument type {0} (expected tracepoint)", ClassName(FromValue(tpval))));
+ }
+ return tp;
+ }
+
+ internal static VALUE rb_tracepoint_enable(VALUE tpval) {
+ ToTracePoint(tpval).Enable();
+ return Qundef;
+ }
+
+ internal static VALUE rb_tracepoint_disable(VALUE tpval) {
+ ToTracePoint(tpval).Disable();
+ return Qundef;
+ }
+
+ internal static VALUE rb_tracepoint_enabled_p(VALUE tpval) {
+ return ToTracePoint(tpval).IsEnabled ? Qtrue : Qfalse;
+ }
+
+ // rb_trace_arg_t is opaque to extensions: IronRuby's is the TracePoint's handle, whose
+ // readers answer for the event being delivered, as tracearg's do.
+ internal static void* rb_tracearg_from_tracepoint(VALUE tpval) {
+ ToTracePoint(tpval);
+ return (void*)tpval;
+ }
+
+ private static VALUE TraceArg(void* arg, string/*!*/ name) {
+ return CallV((VALUE)arg, name);
+ }
+
+ internal static uint rb_tracearg_event_flag(void* arg) {
+ int i = Array.IndexOf(_traceEventNames, FromValue(TraceArg(arg, "event"))?.ToString());
+ return i >= 0 ? 1u << i : 0;
+ }
+
+ internal static VALUE rb_tracearg_event(void* arg) { return TraceArg(arg, "event"); }
+ internal static VALUE rb_tracearg_lineno(void* arg) { return TraceArg(arg, "lineno"); }
+ internal static VALUE rb_tracearg_path(void* arg) { return TraceArg(arg, "path"); }
+ internal static VALUE rb_tracearg_parameters(void* arg) { return TraceArg(arg, "parameters"); }
+ internal static VALUE rb_tracearg_method_id(void* arg) { return TraceArg(arg, "method_id"); }
+ internal static VALUE rb_tracearg_callee_id(void* arg) { return TraceArg(arg, "callee_id"); }
+ internal static VALUE rb_tracearg_defined_class(void* arg) { return TraceArg(arg, "defined_class"); }
+ internal static VALUE rb_tracearg_binding(void* arg) { return TraceArg(arg, "binding"); }
+ internal static VALUE rb_tracearg_self(void* arg) { return TraceArg(arg, "self"); }
+ internal static VALUE rb_tracearg_return_value(void* arg) { return TraceArg(arg, "return_value"); }
+ internal static VALUE rb_tracearg_raised_exception(void* arg) { return TraceArg(arg, "raised_exception"); }
+ internal static VALUE rb_tracearg_eval_script(void* arg) { return TraceArg(arg, "eval_script"); }
+ internal static VALUE rb_tracearg_instruction_sequence(void* arg) { return TraceArg(arg, "instruction_sequence"); }
+
+ #endregion
+
+ #region Debug inspector
+
+ private static delegate* unmanaged[Cdecl] _callInspector;
+
+ ///
+ /// One frame rb_debug_inspector_open saw. Only the C method that opened it and the Ruby
+ /// code that called that method are known in full: IronRuby keeps no chain of the callers'
+ /// scopes, so the frames above them have a location and nothing else.
+ ///
+ private sealed class InspectedFrame {
+ public object Self, Class, Binding, Location;
+ }
+
+ private static InspectedFrame[]/*!*/ InspectFrames() {
+ var locations = Send(_context.KernelModule, "caller_locations", null, 0) as RubyArray ?? new RubyArray();
+ var frame = _frame;
+ int offset = frame != null ? 1 : 0;
+ var frames = new InspectedFrame[locations.Count + offset];
+ for (int i = 0; i < locations.Count; i++) {
+ frames[i + offset] = new InspectedFrame { Location = locations[i] };
+ }
+ if (frame == null) {
+ return frames;
+ }
+
+ // a C frame has no binding; its location is its caller's, as a cfunc frame's is in CRuby
+ frames[0] = new InspectedFrame {
+ Self = frame.Self,
+ Class = frame.Method.Owner,
+ Location = locations.Count > 0 ? locations[0] : null,
+ };
+ var scope = frame.Scope;
+ if (scope != null && frames.Length > 1) {
+ var binding = Binding.Create(scope, scope.SelfObject);
+ string path;
+ int line;
+ if (scope.TryGetCurrentSourceLocation(out path, out line)) {
+ binding.SourcePath = path;
+ binding.SourceLine = line;
+ }
+ var methodScope = scope.GetInnerMostMethodScope();
+ frames[1].Self = scope.SelfObject;
+ frames[1].Class = methodScope != null ? (object)methodScope.DeclaringModule : null;
+ frames[1].Binding = binding;
+ }
+ return frames;
+ }
+
+ internal static VALUE rb_debug_inspector_open(IntPtr func, void* data) {
+ if (_callInspector == null) {
+ _callInspector = (delegate* unmanaged[Cdecl])ShimExport("rb_ir_call_inspector");
+ }
+ var handle = GCHandle.Alloc(InspectFrames());
+ try {
+ int raised;
+ VALUE result;
+ var depth = EnterNative();
+ try {
+ result = _callInspector((void*)func, (void*)GCHandle.ToIntPtr(handle), data, &raised);
+ } finally {
+ LeaveNative(depth);
+ }
+ if (raised != 0) {
+ Rethrow();
+ }
+ return result;
+ } finally {
+ handle.Free();
+ }
+ }
+
+ private static InspectedFrame/*!*/ InspectedFrameAt(void* dc, long index) {
+ var frames = (InspectedFrame[])GCHandle.FromIntPtr((IntPtr)dc).Target;
+ long i = index;
+ if (i < 0 || i >= frames.Length) {
+ throw RubyExceptions.CreateArgumentError("no such frame");
+ }
+ return frames[i];
+ }
+
+ internal static VALUE rb_debug_inspector_backtrace_locations(void* dc) {
+ var frames = (InspectedFrame[])GCHandle.FromIntPtr((IntPtr)dc).Target;
+ var result = new RubyArray(frames.Length);
+ foreach (var frame in frames) {
+ result.Add(frame.Location);
+ }
+ return ToValue(result);
+ }
+
+ internal static VALUE rb_debug_inspector_frame_self_get(void* dc, long index) { return ToValue(InspectedFrameAt(dc, index).Self); }
+ internal static VALUE rb_debug_inspector_frame_class_get(void* dc, long index) { return ToValue(InspectedFrameAt(dc, index).Class); }
+ internal static VALUE rb_debug_inspector_frame_binding_get(void* dc, long index) { return ToValue(InspectedFrameAt(dc, index).Binding); }
+
+ // IronRuby has no RubyVM::InstructionSequence
+ internal static VALUE rb_debug_inspector_frame_iseq_get(void* dc, long index) {
+ InspectedFrameAt(dc, index);
+ return Qnil;
+ }
+
+ // the frames are counted from the outermost, as CRuby's depth is
+ internal static VALUE rb_debug_inspector_frame_depth(void* dc, long index) {
+ var frames = (InspectedFrame[])GCHandle.FromIntPtr((IntPtr)dc).Target;
+ InspectedFrameAt(dc, index);
+ return ToValue(frames.Length - 1 - index);
+ }
+
+ internal static VALUE rb_debug_inspector_current_depth() {
+ return ToValue((long)InspectFrames().Length);
+ }
+
+ #endregion
+
+ #region ObjectSpace.memsize_of
+
+ private static delegate* unmanaged[Cdecl] _typedDataMemsize;
+
+ internal static long TypedDataMemsize(DataObject/*!*/ obj) {
+ if (_typedDataMemsize == null) {
+ _typedDataMemsize = (delegate* unmanaged[Cdecl])ShimExport("rb_ir_typed_data_memsize");
+ }
+ int raised;
+ nuint size;
+ var depth = EnterNative();
+ try {
+ size = _typedDataMemsize(ToValue(obj), &raised);
+ } finally {
+ LeaveNative(depth);
+ }
+ if (raised != 0) {
+ Rethrow();
+ }
+ return (long)size;
+ }
+
+ #endregion
+ }
+}
diff --git a/Src/Ruby/CApi/CApi.Generated.cs b/Src/Ruby/CApi/CApi.Generated.cs
index c34c3d29e..82a033f21 100644
--- a/Src/Ruby/CApi/CApi.Generated.cs
+++ b/Src/Ruby/CApi/CApi.Generated.cs
@@ -5,555 +5,583 @@
namespace IronRuby.Runtime.CApi {
internal static unsafe partial class CApi {
- internal const int FunctionCount = 546;
+ internal const int FunctionCount = 574;
internal static void FillFunctionTable(IntPtr* table) {
table[0] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_builtin_type;
table[1] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_rbasic_class;
table[2] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_define_dummy_encoding;
- table[3] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_fl_test;
- table[4] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_fl_set;
- table[5] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_fl_unset;
- table[6] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_fl_reverse;
- table[7] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_rstring_len;
- table[8] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_rstring_ptr;
- table[9] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_rarray_len;
- table[10] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_rarray_ptr;
- table[11] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_rarray_aref;
- table[12] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_rarray_aset;
- table[13] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_caught;
- table[14] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_rescue_match;
- table[15] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_current_exception;
- table[16] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_set_current_exception;
- table[17] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_warn;
- table[18] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_str_new_buffer;
- table[19] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_raise_notimp;
- table[20] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ir_bug;
- table[21] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_string_value_cstr;
- table[22] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_subpos;
- table[23] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_id2name;
- table[24] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_obj_classname;
- table[25] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_sourcefile;
- table[26] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_big2dbl;
- table[27] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_cstr_to_dbl;
- table[28] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_float_value;
- table[29] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_num2dbl;
- table[30] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_to_dbl;
- table[31] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_frame_this_func;
- table[32] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_intern2;
- table[33] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_intern;
- table[34] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_intern_str;
- table[35] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_check_id;
- table[36] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_check_symbol;
- table[37] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_check_id_cstr;
- table[38] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_check_symbol_cstr;
- table[39] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_sym2id;
- table[40] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_to_id;
- table[41] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ascii8bit_encindex;
- table[42] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_block_given_p;
- table[43] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_cmpint;
- table[44] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_const_defined;
- table[45] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_during_gc;
- table[46] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_enc_find_index;
- table[47] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_enc_get_index;
- table[48] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_eql;
- table[49] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_integer_pack;
- table[50] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_keyword_given_p;
- table[51] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_respond_to;
- table[52] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_sourceline;
- table[53] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_cmp;
- table[54] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_usascii_encindex;
- table[55] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_utf8_encindex;
- table[56] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_big2ll;
- table[57] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_num2ll;
- table[58] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_big2long;
- table[59] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_fix2int;
- table[60] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_num2int;
- table[61] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_num2long;
- table[62] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_strlen;
- table[63] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_sublen;
- table[64] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ascii8bit_encoding;
- table[65] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_enc_find;
- table[66] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_enc_from_index;
- table[67] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_enc_get;
- table[68] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_to_encoding;
- table[69] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_usascii_encoding;
- table[70] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_utf8_encoding;
- table[71] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_fix2short;
- table[72] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_num2short;
- table[73] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_capacity;
- table[74] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_hash;
- table[75] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_big2ull;
- table[76] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_num2ull;
- table[77] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_big2ulong;
- table[78] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_num2uint;
- table[79] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_num2ulong;
- table[80] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_num2ushort;
- table[81] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_any_to_s;
- table[82] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_Array;
- table[83] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_aref;
- table[84] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_cat;
- table[85] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_clear;
- table[86] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_concat;
- table[87] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_delete_at;
- table[88] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_delete;
- table[89] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_dup;
- table[90] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_entry;
- table[91] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_freeze;
- table[92] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_hidden_new;
- table[93] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_includes;
- table[94] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_join;
- table[95] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_new_capa;
- table[96] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_new_from_values;
- table[97] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_new;
- table[98] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_plus;
- table[99] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_pop;
- table[100] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_push;
- table[101] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_reverse;
- table[102] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_rotate;
- table[103] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_shift;
- table[104] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_sort_bang;
- table[105] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_sort;
- table[106] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_subseq;
- table[107] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_to_ary;
- table[108] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_to_s;
- table[109] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ary_unshift;
- table[110] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_assoc_new;
- table[111] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_attr_get;
- table[112] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_big2str;
- table[113] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_block_call;
- table[114] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_block_proc;
- table[115] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_call_super;
- table[116] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_check_string_type;
- table[117] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_class_get_superclass;
- table[118] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_class_inherited_p;
- table[119] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_class_name;
- table[120] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_class_new_instance;
- table[121] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_class_path;
- table[122] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_class_superclass;
- table[123] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_const_get_at;
- table[124] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_const_get;
- table[125] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_cstr2inum;
- table[126] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_cstr_to_inum;
- table[127] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_dbl2big;
- table[128] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_define_class;
- table[129] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_define_class_under;
- table[130] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_define_module;
- table[131] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_define_module_under;
- table[132] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_each;
- table[133] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_enc_associate_index;
- table[134] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_enc_associate;
- table[135] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_enc_from_encoding;
- table[136] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_enc_interned_str;
- table[137] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_enc_interned_str_cstr;
- table[138] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_enc_str_buf_cat;
- table[139] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_enc_str_new;
- table[140] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_enc_str_new_cstr;
- table[141] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_equal;
- table[142] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_errinfo;
- table[143] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_eval_string;
- table[144] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_exc_new_cstr;
- table[145] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_exc_new_str;
- table[146] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_exc_new;
- table[147] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_external_str_new;
- table[148] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_external_str_new_cstr;
- table[149] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_external_str_new_with_enc;
- table[150] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_fix2str;
- table[151] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_float_new;
- table[152] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_float_new_in_heap;
- table[153] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_Float;
- table[154] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_funcall_passing_block;
- table[155] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_funcallv_kw;
- table[156] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_funcallv_public;
- table[157] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_funcallv;
- table[158] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_funcall_with_block;
- table[159] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_gc_location;
- table[160] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_gv_get;
- table[161] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_gv_set;
- table[162] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_hash_aref;
- table[163] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_hash_aset;
- table[164] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_hash_clear;
- table[165] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_hash_delete;
- table[166] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_hash_dup;
- table[167] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_hash_lookup2;
- table[168] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_hash_lookup;
- table[169] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_hash_new;
- table[170] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_hash_size;
- table[171] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_id2str;
- table[172] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_id2sym;
- table[173] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_inspect;
- table[174] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_int2big;
- table[175] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_Integer;
- table[176] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_interned_str;
- table[177] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_interned_str_cstr;
- table[178] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_int_positive_pow;
- table[179] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_iterate;
- table[180] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ivar_defined;
- table[181] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ivar_get;
- table[182] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ivar_set;
- table[183] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_iv_get;
- table[184] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_iv_set;
- table[185] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_ll2inum;
- table[186] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_locale_str_new;
- table[187] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_locale_str_new_cstr;
- table[188] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_mod_ancestors;
- table[189] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_mod_name;
- table[190] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_mutex_new;
- table[191] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_num2fix;
- table[192] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_obj_alloc;
- table[193] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_obj_as_string;
- table[194] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_obj_class;
- table[195] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_obj_clone;
- table[196] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_obj_dup;
- table[197] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_obj_encoding;
- table[198] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_obj_freeze;
- table[199] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_obj_frozen_p;
- table[200] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_obj_hide;
- table[201] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_obj_id;
- table[202] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_obj_instance_eval;
- table[203] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_obj_is_instance_of;
- table[204] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_obj_is_kind_of;
- table[205] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_obj_reveal;
- table[206] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_path2class;
- table[207] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_require;
- table[208] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_singleton_class;
- table[209] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str2inum;
- table[210] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_append;
- table[211] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_buf_append;
- table[212] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_buf_new;
- table[213] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_cat_cstr;
- table[214] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_cat;
- table[215] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_conv_enc_opts;
- table[216] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_conv_enc;
- table[217] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_drop_bytes;
- table[218] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_dup;
- table[219] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_encode;
- table[220] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_equal;
- table[221] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_export_locale;
- table[222] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_export_to_enc;
- table[223] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_export;
- table[224] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_freeze;
- table[225] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_String;
- table[226] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_string_value;
- table[227] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_inspect;
- table[228] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_intern;
- table[229] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_length;
- table[230] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_locktmp;
- table[231] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_new;
- table[232] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_new_cstr;
- table[233] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_new_frozen;
- table[234] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_new_shared;
- table[235] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_new_static;
- table[236] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_new_with_class;
- table[237] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_plus;
- table[238] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_resize;
- table[239] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_split;
- table[240] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_subseq;
- table[241] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_substr;
- table[242] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_times;
- table[243] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_tmp_new;
- table[244] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_to_interned_str;
- table[245] = (IntPtr)(delegate* unmanaged[Cdecl])&Entry_rb_str_to_str;
- table[246] = (IntPtr)(delegate* unmanaged[Cdecl]