Skip to content

Instantly share code, notes, and snippets.

@gerdr

gerdr/test.nqp Secret

Last active December 22, 2015 19:58
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/02a79383788fb1254978 to your computer and use it in GitHub Desktop.
Save gerdr/02a79383788fb1254978 to your computer and use it in GitHub Desktop.
my $blob := nqp::bloballoc(42);
my $intptr := nqp::cscalar(Nil, 5); # no HOW
# 5 is the magic number for 'int'
my $ptr := nqp::blobptr($blob, $intptr);
nqp::assign($ptr, 12345); # boxed
my $val := nqp::cscalar_decont_i($ptr); # native
nqp::say($val);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment