aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-06-29 18:46:10 +0200
committerHarald Welte <laforge@gnumonks.org>2011-06-29 18:46:10 +0200
commit9e1f0604b5d081197d1b2d5adbc8499074e6717e (patch)
treedbc3f3721822a9aa786f4d33a1bd0c38dad9ef85
parent7721a77eafcfffbfcc2d8027dd4134bb9a9cc2b9 (diff)
add msgb_set_talloc_ctx() to set the talloc context for msgb allocations
-rw-r--r--include/osmocom/core/msgb.h2
-rw-r--r--src/msgb.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h
index 8665c2bf..58976f7f 100644
--- a/include/osmocom/core/msgb.h
+++ b/include/osmocom/core/msgb.h
@@ -193,5 +193,7 @@ static inline struct msgb *msgb_alloc_headroom(int size, int headroom,
uint8_t *msgb_data(const struct msgb *msg);
uint16_t msgb_length(const struct msgb *msg);
+/* set the talloc context for msgb_alloc[_headroom] */
+void msgb_set_talloc_ctx(void *ctx);
#endif /* _MSGB_H */
diff --git a/src/msgb.c b/src/msgb.c
index d2c167aa..f9841ed1 100644
--- a/src/msgb.c
+++ b/src/msgb.c
@@ -98,3 +98,8 @@ uint16_t msgb_length(const struct msgb *msg)
{
return msg->len;
}
+
+void msgb_set_talloc_ctx(void *ctx)
+{
+ tall_msgb_ctx = ctx;
+}