From ff1790ae22fe8acb77f60e1617115b8ba7257487 Mon Sep 17 00:00:00 2001 From: xtremegamer1 Date: Fri, 14 Oct 2022 07:13:44 -0600 Subject: [PATCH] removed prints now that the memory leaks are gone --- include/uc_allocation_tracker.hpp | 3 ++- src/uc_allocation_tracker.cpp | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/uc_allocation_tracker.hpp b/include/uc_allocation_tracker.hpp index 8dd1aa2..ac50d6b 100644 --- a/include/uc_allocation_tracker.hpp +++ b/include/uc_allocation_tracker.hpp @@ -3,4 +3,5 @@ extern int g_allocation_tracker; uc_err uct_context_alloc(uc_engine *uc, uc_context **context); -uc_err uct_context_free(uc_context *context); \ No newline at end of file +uc_err uct_context_free(uc_context *context); +void print_allocation_number(); \ No newline at end of file diff --git a/src/uc_allocation_tracker.cpp b/src/uc_allocation_tracker.cpp index 076c208..95fc2a4 100644 --- a/src/uc_allocation_tracker.cpp +++ b/src/uc_allocation_tracker.cpp @@ -5,11 +5,18 @@ int g_allocation_tracker; uc_err uct_context_alloc(uc_engine *uc, uc_context **context) { - std::printf("Allocations: %p\n", ++g_allocation_tracker); + ++g_allocation_tracker; + //std::printf("Allocations: %p\n", g_allocation_tracker); return uc_context_alloc(uc, context); } uc_err uct_context_free(uc_context *context) { - std::printf("Allocations: %p\n", --g_allocation_tracker); + +g_allocation_tracker--; + //std::printf("Allocations: %p\n", g_allocation_tracker); return uc_context_free(context); +} + +void print_allocation_number() +{ + std::printf("uc_context allocations: %p\n", g_allocation_tracker); } \ No newline at end of file