diff options
author | Harald Welte <laforge@gnumonks.org> | 2009-06-26 19:39:35 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2009-06-26 19:39:35 +0200 |
commit | 966636f39f17e5d42e7918a2055d400c791671b4 (patch) | |
tree | f7bc3c7ac76e2c63ad4a1f5190ed218ab53c2c6b /openbsc/include | |
parent | f16571635a9d81893cb7bcc3d12dbf6639f3b3df (diff) |
use named variant when allocating msgb's
when we generate a talloc report (SIGUSR1), we can now see which system
allocated a given msgb, this helps memory leak debugging
Diffstat (limited to 'openbsc/include')
-rw-r--r-- | openbsc/include/openbsc/msgb.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/openbsc/include/openbsc/msgb.h b/openbsc/include/openbsc/msgb.h index 2c31d1587..5ecac459b 100644 --- a/openbsc/include/openbsc/msgb.h +++ b/openbsc/include/openbsc/msgb.h @@ -47,7 +47,7 @@ struct msgb { unsigned char _data[0]; }; -extern struct msgb *msgb_alloc(u_int16_t size); +extern struct msgb *msgb_alloc(u_int16_t size, const char *name); extern void msgb_free(struct msgb *m); extern void msgb_enqueue(struct llist_head *queue, struct msgb *msg); extern struct msgb *msgb_dequeue(struct llist_head *queue); @@ -100,9 +100,10 @@ static inline void msgb_reserve(struct msgb *msg, int len) msg->tail += len; } -static inline struct msgb *msgb_alloc_headroom(int size, int headroom) +static inline struct msgb *msgb_alloc_headroom(int size, int headroom, + const char *name) { - struct msgb *msg = msgb_alloc(size); + struct msgb *msg = msgb_alloc(size, name); if (msg) msgb_reserve(msg, headroom); return msg; |