#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <xbyak/xbyak.h>
Go to the source code of this file.
◆ XBYAK_NO_OP_NAMES
#define XBYAK_NO_OP_NAMES |
◆ main()
Definition at line 79 of file memfunc.cpp.
80{
81#ifdef XBYAK64
83#else
85#endif
86#ifdef _WIN32
87 puts(" win");
88#else
89 puts(" linux");
90#endif
91 try {
93 int (
A::*
p)(int, int, int, int, int)
const = 0;
94 const void *addr = code.
getCode<
void*>();
95 memcpy(&
p, &addr,
sizeof(
void*));
96 for (int i = 0; i < 10; i++) {
98 int t1, t2, t3, t4, t5, x,
y;
99 a.x_ = rand();
a.y_ = rand();
100 t1 = rand(); t2 = rand(); t3 = rand();
101 t4 = rand(); t5 = rand();
102 x =
a.func(t1, t2, t3, t4, t5);
103 y = (
a.*
p)(t1, t2, t3, t4, t5);
104 printf(
"%c %d, %d\n", x == y ?
'o' :
'x', x, y);
105 }
106 } catch (std::exception& e) {
107 printf(
"err=%s\n", e.what());
108 return 1;
109 }
110}
const uint8 * getCode() const
LOGGING_API void printf(Category category, const char *format,...)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
memcpy((char *) pInfo->slotDescription, s, l)