-
Notifications
You must be signed in to change notification settings - Fork 34
Conversation
proc.e is now a union type and the only way to assign values to it is by converting the raw data to a fixed size byte array.
I ran into a lot of trouble adapting 1.4 because there were significant
changes to the core types and macros. I will look this over later tonight
but I am honestly a little pessimistic that you fixed it so quickly. :)
Either way thanks for looking into it. Ping me if you don't hear from me by
tomorrow morning.
…On Wed, Feb 6, 2019 at 1:44 PM Bence Monus ***@***.***> wrote:
These changes should fix the build against MRuby 2.0.0. [#72
<#72>]
The example code in the readme runs fine.
At least one test blows up with a stack corruption error so some
additional fixes are needed. There may well be better ways to do this, the
change in value.go is especially ugly but fixing this has already pushed
my cgo to the limits so I can't do more I'm afraid. Hopefully this will
help others to pick up the project and give it some more love.
------------------------------
You can view, comment on, or merge this pull request online at:
#73
Commit Summary
- mrb_ary_len was replaced with a macro that needs a wrapper
- update code with RProc struct changes
File Changes
- *M* array.go
<https://github.com/mitchellh/go-mruby/pull/73/files#diff-0> (3)
- *M* func.go
<https://github.com/mitchellh/go-mruby/pull/73/files#diff-1> (2)
- *M* value.go
<https://github.com/mitchellh/go-mruby/pull/73/files#diff-2> (2)
Patch Links:
- https://github.com/mitchellh/go-mruby/pull/73.patch
- https://github.com/mitchellh/go-mruby/pull/73.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#73>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABJ6wDojmmGozumBVT_1nLMHqR_6-xeks5vK0yygaJpZM4amK7K>
.
|
@erikh I'm pretty sure I haven't "fixed" it, I just managed to get the code to compile :) |
Fair play! I'll see if I can help when I review.
…On Wed, Feb 6, 2019 at 2:30 PM Bence Monus ***@***.***> wrote:
@erikh <https://github.com/erikh> I'm pretty sure I haven't "fixed" it, I
just managed to get the code to compile :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#73 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABJ6xEXJOGSPrb1YFd15rxorWxc6EB5ks5vK1eSgaJpZM4amK7K>
.
|
array.go
Outdated
@@ -1,6 +1,7 @@ | |||
package mruby | |||
|
|||
// #include "gomruby.h" | |||
// mrb_int _mrb_ary_len(mrb_value ary) { return RARRAY_LEN(ary); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put this definition in gomruby.h
instead of here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I thought about this one after I went to bed.
@@ -139,7 +139,7 @@ func (v *MrbValue) GCProtect() { | |||
// when this value is a proc. | |||
func (v *MrbValue) SetProcTargetClass(c *Class) { | |||
proc := C._go_mrb_proc_ptr(v.value) | |||
proc.target_class = c.class | |||
proc.e = *(*[8]byte)(unsafe.Pointer(&c.class)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this isn't going to work, unless 2.0 has reverted some of the structs this will fail; the target_class notion has completely been changed in 1.4.
I need to read the 2.0 source before I can comment further.
any progress with this? I was curious if you had a chance to figure out the trampoline changes. |
These changes should fix the build against MRuby 2.0.0. [#72]
The example code in the readme runs fine.
At least one test blows up with a stack corruption error so some additional fixes are needed. There may well be better ways to do this, the change in
value.go
is especially ugly but fixing this has already pushed my cgo to the limits so I can't do more I'm afraid. Hopefully this will help others to pick up the project and give it some more love.