add tools/addrs

This commit is contained in:
Carl Pearson
2019-09-25 15:45:18 -05:00
parent cd9a95365f
commit 64eb67cc2d
2 changed files with 12 additions and 0 deletions

View File

@@ -52,6 +52,8 @@ target_link_libraries(max-os-perf perfect)
add_executable(min-os-perf min_os_perf.cpp)
target_link_libraries(min-os-perf perfect)
add_executable(addrs addrs.cpp)
## OpenMP
find_package(OpenMP)
if (OpenMP_FOUND)

10
tools/addrs.cpp Normal file
View File

@@ -0,0 +1,10 @@
#include <iostream>
int main(void) {
int a;
int *b = new int;
std::cout << "main: " << uintptr_t(main) << "\n";
std::cout << "stack: " << uintptr_t(&a) << "\n";
std::cout << "heap: " << uintptr_t(b) << "\n";
delete b;
}