Skip to content

Instantly share code, notes, and snippets.

@FROGGS
Created July 7, 2014 07:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save FROGGS/79fe3fcf799724fa6106 to your computer and use it in GitHub Desktop.
use NativeCall;
class MVMCollectable is repr('CStruct') {
has uint32 $.owner;
has uint16 $.flags;
has uint16 $.size;
}
my int8 $x = 42;
say nativecast(MVMCollectable, OpaquePointer.new($x.WHERE))
# OUTPUT MVMCollectable.new(owner => 1, flags => 0, size => 40)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment