add_library(malloctrace SHARED malloctrace.cpp)
target_link_libraries(malloctrace -ldl -lunwind)
-add_executable(test_c test.c)
-add_executable(test_cpp test.cpp)
-
install(TARGETS mallocinfo RUNTIME DESTINATION bin)
+
+add_subdirectory(tests)
--- /dev/null
+set(CMAKE_BUILD_TYPE Debug)
+
+add_executable(test_c test.c)
+add_executable(test_cpp test.cpp)
int* i;
};
+void asdf()
+{
+ int* i = new int;
+ printf("i in asdf: %p\n", i);
+ delete i;
+}
+
+void bar()
+{
+ asdf();
+}
+
+void laaa()
+{
+ bar();
+}
+
static Foo foo;
int main()
printf("posix_memalign: %p\n", buf);
free(buf);
+ for (int i = 0; i < 10; ++i) {
+ laaa();
+ }
+ laaa();
+
return 0;
}