This file contains 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
// On my system: | |
// virtual call time: 4.340 | |
// non-virtual call time: 3.970 | |
// virtual call overhead 9.32% | |
#include <stdlib.h> | |
#include <time.h> | |
#include <stdio.h> | |
#define NOINLINE __attribute__ ((noinline)) |
This file contains 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
// Output on my system: | |
// virtual call time: 4.340 | |
// non-virtual call time: 3.970 | |
// virtual call overhead 9.32% | |
#include <stdlib.h> | |
#include <time.h> | |
#include <stdio.h> | |
#define NOINLINE __attribute__ ((noinline)) |
This file contains 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 <string.h> | |
#include <sys/mman.h> | |
int main(int argc, char *argv[]) { | |
// Machine code for: | |
// mov eax, 0 | |
// ret | |
unsigned char code[] = {0xb8, 0x00, 0x00, 0x00, 0x00, 0xc3}; |
NewerOlder