Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
memfunc.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <xbyak/xbyak.h>
Include dependency graph for memfunc.cpp:

Go to the source code of this file.

Classes

struct  A
 
struct  Code
 

Macros

#define XBYAK_NO_OP_NAMES
 

Functions

int main ()
 

Macro Definition Documentation

◆ XBYAK_NO_OP_NAMES

#define XBYAK_NO_OP_NAMES

Definition at line 4 of file memfunc.cpp.

Function Documentation

◆ main()

int main ( void )

Definition at line 79 of file memfunc.cpp.

80{
81#ifdef XBYAK64
82 printf("64bit");
83#else
84 printf("32bit");
85#endif
86#ifdef _WIN32
87 puts(" win");
88#else
89 puts(" linux");
90#endif
91 try {
92 Code code;
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++) {
97 A a;
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 mie::Vuint & p
Definition bn.cpp:27
const uint8 * getCode() const
Definition xbyak.h:905
LOGGING_API void printf(Category category, const char *format,...)
Definition Logging.cpp:30
uint64_t y
Definition sha3.cpp:34
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
Definition bench.cpp:18
memcpy((char *) pInfo->slotDescription, s, l)
Here is the call graph for this function: