From f269f6d1d5dee177251cd2468b76a90ff677a4d5 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 20 Mar 2019 11:39:40 +0100 Subject: make use of OTC_GLOBAL when allocating library-internal contexts As libosmcore is now managing the global talloc contexts, there's no point in having APIs where the user tells the library about which talloc contexts to use for a given sub-system. However, completely ignoring the talloc contexts passed in by existing applications would unfortunately break LeakSanitizer. It appears to track if any dynamically allocated pointeres are not stored anywhere, and that would be exactly the situation created here. So the new behavior is: Use the context passed in by an application, and fall back to the library-internal OTC_GLOBAL if none is passed in. Change-Id: I48f475efd3ee0d5120b8fc30861e852d1a6920b1 --- include/osmocom/core/signal.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/osmocom') diff --git a/include/osmocom/core/signal.h b/include/osmocom/core/signal.h index 449b9762..0f178439 100644 --- a/include/osmocom/core/signal.h +++ b/include/osmocom/core/signal.h @@ -1,6 +1,7 @@ #pragma once #include +#include /*! \defgroup signal Intra-application signals * @{ @@ -34,7 +35,8 @@ typedef int osmo_signal_cbfn(unsigned int subsys, unsigned int signal, void *han /* Management */ -void *osmo_signal_talloc_ctx_init(void *root_ctx); +void *osmo_signal_talloc_ctx_init(void *root_ctx) + OSMO_DEPRECATED("libosmocore internally allocates this context now."); int osmo_signal_register_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data); void osmo_signal_unregister_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data); -- cgit v1.2.3