http://homepage1.nifty.com/herumi/diary/0709.html#25
call((int)func);
たまにおかしな動きをするのですが,私が悪いような気がしなくもないので
今度調べてみます.今日は今から飲むので・・・
void myputs(const char*s)
{
puts(s);
}
struct Hello : public Xbyak::CodeGenerator
{
Hello()
{
push((int)"hello");
call((int)puts);
pop(eax);
}
};
struct Hello2 : public Xbyak::CodeGenerator
{
Hello2()
{
push((int)"hello");
call((int)myputs);
pop(eax);
}
};
int main(int argc, char**argv)
{
Hello h;
Hello2 h2;
((f*)h.getCode())(); // OK
((f*)h2.getCode())(); // NG
return 0;
}
だった.
UMのJITにひどいバグがあるなぁ・・・ 前のコードに戻そうかなぁ
メモリのコピーを減らそうとして,スタックを食い尽くすとか,ひどい改悪をしたんだなぁ
だいぶ前に修正したものをアップしておきました.
どんな問題点があったか覚えてないので,かなり怪しいですが・・・
http://www.blokus.com/online-game/
と戦ってみたら,勝った.4文字コードを打つのがめんどくさい.