externals: Update xbyak to v5.601

Merge commit 'dbb1f8cf37' into HEAD
This commit is contained in:
MerryMage 2020-04-22 20:53:27 +01:00
commit 1b3b98c3f7
20 changed files with 253 additions and 153 deletions

View file

@ -162,18 +162,21 @@ int main()
{
// use memory allocated by user
using namespace Xbyak;
const size_t codeSize = 1024;
const size_t codeSize = 4096;
uint8 buf[codeSize + 16];
uint8 *p = CodeArray::getAlignedAddress(buf);
CodeArray::protect(p, codeSize, true);
Sample s(p, codeSize);
if (!CodeArray::protect(p, codeSize, CodeArray::PROTECT_RWE)) {
fprintf(stderr, "can't protect\n");
return 1;
}
int (*func)(int) = s.getCode<int (*)(int)>();
if (Xbyak::CastTo<uint8*>(func) != p) {
fprintf(stderr, "internal error %p %p\n", p, Xbyak::CastTo<uint8*>(func));
return 1;
}
printf("0 + ... + %d = %d\n", 100, func(100));
CodeArray::protect(p, codeSize, false);
CodeArray::protect(p, codeSize, CodeArray::PROTECT_RW);
}
puts("OK");
testReset();