From 3c244f304dd3f2a7050c5313e412ded0315bfb0c Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Wed, 12 Jul 2023 13:36:17 -0700 Subject: til_stream: clarify c->n_contexts reuse til_stream_register_module_contexts() reuses the container when c->n_contexts is sufficiently large, and deliberately leaves c->n_contexts as-is to potentially accomodate a larger set in the future. The excess was NULLified in prepping for reuse so it should be fine, just add a blurb about it so it doesn't look like an oversight. --- src/til_stream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/til_stream.c b/src/til_stream.c index 0ff988c..f6cf987 100644 --- a/src/til_stream.c +++ b/src/til_stream.c @@ -575,6 +575,7 @@ int til_stream_register_module_contexts(til_stream_t *stream, size_t n_contexts, c->n_module_contexts = n_contexts; } + /* XXX: note in the reused case c->n_contexts may exceed n_contexts, but they're NULL */ for (size_t i = 0; i < n_contexts; i++) c->module_contexts[i] = til_module_context_ref(contexts[i]); -- cgit v1.2.3