This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define MVMint32 int | |
#ifdef __GNUC__ | |
#define FFS(x) __builtin_ffs(x) | |
#elif defined(_MSC_VER) | |
static __inline MVMint32 FFS(MVMint32 x) { | |
MVMint32 i = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ObjHash { | |
has %!keys handles (keys => 'values'); | |
has %!values handles <values elems>; | |
method at_key(Mu $key) is rw { | |
my $lkey = $key.WHICH; | |
%!values.exists($lkey) | |
?? %!values{$lkey} | |
!! pir::setattribute__0PPsP(my $v, Scalar, '$!whence', | |
-> { | |
%!keys{$lkey} := $key; |