You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to craft a binding from rust into mruby (sebastianedwards/rust-mruby is obsolete). In debugging a segfault in a foreign function, I get conflicting answers as to the alignment of a rust struct.
pubfnalign_of<T>() -> uint{// We use the preferred alignment as the default alignment for a type. This// appears to be what clang migrated towards as well://// http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20110725/044411.htmlunsafe{ intrinsics::pref_align_of::<T>()}}
I guess tydescs return the actual alignment. It's sort of weird to have a size that isn't a multiple of the alignment, isn't it? The second element in a [MRubyValue] wouldn't be aligned if align_of was right!
I'm trying to craft a binding from rust into mruby (sebastianedwards/rust-mruby is obsolete). In debugging a segfault in a foreign function, I get conflicting answers as to the alignment of a rust struct.
Printing the size and align gives
I found some code on the internet which supposedly prints the same information, but the alignment is different.
Is this a rust problem or a misunderstanding of the output? Thanks.
The text was updated successfully, but these errors were encountered: