summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-07-12 13:36:17 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-07-12 13:38:32 -0700
commit3c244f304dd3f2a7050c5313e412ded0315bfb0c (patch)
tree4a99d57e66105953a57ceba674297b32b4e8a44a /src
parent112cf7f621dc9a5900674d2bc5d99dd0e34e451d (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/til_stream.c1
1 files changed, 1 insertions, 0 deletions
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]);
© All Rights Reserved