[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Call event_set_mem_functions during initialization



commit 1e296bc6de010f1de8877ad9ed9b9d2a21b13801
Author: rl1987 <rl1987@xxxxxxxxxxxxxxxx>
Date:   Tue Sep 4 21:39:11 2018 +0300

    Call event_set_mem_functions during initialization
---
 changes/ticket8415       | 4 ++++
 src/core/mainloop/main.c | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/changes/ticket8415 b/changes/ticket8415
new file mode 100644
index 000000000..992e8e1a1
--- /dev/null
+++ b/changes/ticket8415
@@ -0,0 +1,4 @@
+  o Minor features (memory management):
+    - Get libevent code to use the same memory allocator that
+      Tor code is using by calling event_set_mem_functions()
+      during initialization. Resolves ticket 8415.
diff --git a/src/core/mainloop/main.c b/src/core/mainloop/main.c
index 781e093d9..0a9d4d83e 100644
--- a/src/core/mainloop/main.c
+++ b/src/core/mainloop/main.c
@@ -4242,6 +4242,11 @@ tor_run_main(const tor_main_configuration_t *tor_cfg)
                strerror(-bt_err));
     }
   }
+
+#ifdef EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
+  event_set_mem_functions(tor_malloc_, tor_realloc_, tor_free_);
+#endif
+
   init_protocol_warning_severity_level();
 
   update_approx_time(time(NULL));



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits