Skip to content

Instantly share code, notes, and snippets.

@gerdr

gerdr/test.nqp Secret

Created September 12, 2013 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerdr/a62b4ee5e43048f0a6a8 to your computer and use it in GitHub Desktop.
Save gerdr/a62b4ee5e43048f0a6a8 to your computer and use it in GitHub Desktop.
my $vmptrtype := nqp::ptrtype();
my $scalartype := nqp::cscalar(26); # void *
my $blob := nqp::bloballoc(8);
my $p1 := nqp::blobptr($blob, $scalartype);
nqp::assign($p1, $p1);
my $p2 := nqp::decont($p1);
$p1 := nqp::ptrcast($p1, $vmptrtype, 0);
$p2 := nqp::ptrcast($p2, $vmptrtype, 0);
nqp::say(nqp::unbox_i($p1));
nqp::say(nqp::unbox_i($p2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment