centralized performance resources
This commit is contained in:
commit
50b15a1522
63 changed files with 328466 additions and 0 deletions
BIN
ocw/bit-hacks/a.out
Executable file
BIN
ocw/bit-hacks/a.out
Executable file
Binary file not shown.
2
ocw/bit-hacks/a.py
Normal file
2
ocw/bit-hacks/a.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
class S:
|
||||
def __init__(self)
|
||||
2
ocw/bit-hacks/compile_flags.txt
Normal file
2
ocw/bit-hacks/compile_flags.txt
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
-O2
|
||||
-masm=intel
|
||||
12
ocw/bit-hacks/hacks.cc
Normal file
12
ocw/bit-hacks/hacks.cc
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
int x = 123;
|
||||
int y = 123123;
|
||||
|
||||
std::cout << x;
|
||||
std::swap(x, y);
|
||||
std::cout << y;
|
||||
|
||||
return 0;
|
||||
}
|
||||
BIN
ocw/bit-hacks/structop
Executable file
BIN
ocw/bit-hacks/structop
Executable file
Binary file not shown.
15
ocw/bit-hacks/structop.cc
Normal file
15
ocw/bit-hacks/structop.cc
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include <cstddef>
|
||||
#include <iostream>
|
||||
|
||||
struct S {
|
||||
char b;
|
||||
int i;
|
||||
};
|
||||
|
||||
int main() {
|
||||
S s;
|
||||
|
||||
std::cout << offsetof(S, i) << '\n';
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue