[PATCH] libosmocore[master]: rate_ctr: doc: explain intentional "mem leak" for mangled gr...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Nov 17 00:27:51 UTC 2017


Review at  https://gerrit.osmocom.org/4866

rate_ctr: doc: explain intentional "mem leak" for mangled group names

Change-Id: I35363c4c1fa0d62fd7fed40fe689487244248a3f
---
M src/rate_ctr.c
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/66/4866/1

diff --git a/src/rate_ctr.c b/src/rate_ctr.c
index 5464490..deb9874 100644
--- a/src/rate_ctr.c
+++ b/src/rate_ctr.c
@@ -178,10 +178,17 @@
 	return NULL;
 }
 
-/*! Allocate a new group of counters according to description
+/*! Allocate a new group of counters according to description.
  *  \param[in] ctx \ref talloc context
  *  \param[in] desc Rate counter group description
  *  \param[in] idx Index of new counter group
+ * Attention: if the description struct (\a desc) contains invalid characters, a mangled description
+ * struct will be allocated on \a ctx, and this newly allocated description struct will *not* be
+ * freed by rate_ctr_group_free(). To have memleak free rate_ctr_group_free(), either free the entire \a
+ * ctx, or use valid names in \a desc -- see osmo_identifier_valid(). In particular, rate counter groups
+ * and items must not contain dots '.', instead rather use ':' as separator.  The main reason is to be
+ * able to provide auto-generated CTRL interface commands that don't conflict with the CTRL separator
+ * '.'.
  */
 struct rate_ctr_group *rate_ctr_group_alloc(void *ctx,
 					    const struct rate_ctr_group_desc *desc,

-- 
To view, visit https://gerrit.osmocom.org/4866
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35363c4c1fa0d62fd7fed40fe689487244248a3f
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list