diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2023-06-12 15:38:11 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-06-12 17:02:58 -0700 |
commit | 8fb3b27efa707f53bf0b0d74aec0e055f0d10e96 (patch) | |
tree | b6dd8014312e1c417f5fa7b819c599959e44fef1 /src/til_module_context.h | |
parent | a3ad7e5bfdbb54f59555bfe408c52a5237db14d3 (diff) |
til_module_context: refcount module contexts
This becomes necessary in a world with
externall-discoverable-on-stream-contexts that can be arbitrarily
referenced by other contexts.
There will probably be more complexity necessary for invalidating
references, but this is a start.
Diffstat (limited to 'src/til_module_context.h')
-rw-r--r-- | src/til_module_context.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/til_module_context.h b/src/til_module_context.h index cbbfb8e..05f77ab 100644 --- a/src/til_module_context.h +++ b/src/til_module_context.h @@ -8,16 +8,19 @@ typedef struct til_stream_t til_stream_t; struct til_module_context_t { const til_module_t *module; - til_stream_t *stream; /* optional stream this context is part of */ + til_stream_t *stream; /* optional stream this context is part of (module_contexts are discoverable @setup->path when part of a stream) */ unsigned seed; unsigned ticks; unsigned n_cpus; til_setup_t *setup; /* Baked setup this context was made from, reffed by context. * Always present as it provides the path, which is generally derived from a settings instance. */ + + unsigned refcount; }; void * til_module_context_new(const til_module_t *module, size_t size, til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup); +void * til_module_context_ref(til_module_context_t *module_context); void * til_module_context_free(til_module_context_t *module_context); #endif |