summaryrefslogtreecommitdiff
path: root/src/til_module_context.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-01-10 15:36:47 -0800
committerVito Caputo <vcaputo@pengaru.com>2023-01-10 23:51:44 -0800
commitd0a302aff0b3da86aa32b3cfea177ec41cc6488d (patch)
tree5d828fb08fc21e2fd98736f9c720a698768f5fb1 /src/til_module_context.h
parent36e06f2ce3f2789bf51dc156820cdf85dc859b55 (diff)
til_module_context: hash the path
The purpose of the context path is to aid in locating the context instance. The initial application of this will be in service of the taps, which require their module's path as a sort of containing directory of the tap name. It'd be convenient to simply add the path hash with the tap hash to produce the tap's "absolute path" hash when looking up in the hash table.
Diffstat (limited to 'src/til_module_context.h')
-rw-r--r--src/til_module_context.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/til_module_context.h b/src/til_module_context.h
index d017a99..b2caf28 100644
--- a/src/til_module_context.h
+++ b/src/til_module_context.h
@@ -1,6 +1,8 @@
#ifndef _TIL_MODULE_CONTEXT_H
#define _TIL_MODULE_CONTEXT_H
+#include <stdint.h>
+
typedef struct til_module_context_t til_module_context_t;
typedef struct til_module_t til_module_t;
@@ -10,6 +12,7 @@ struct til_module_context_t {
unsigned ticks;
unsigned n_cpus;
char *path; /* for locating this instance of the module, NOT a file path */
+ uint32_t path_hash;
};
void * til_module_context_new(size_t size, unsigned seed, unsigned ticks, unsigned n_cpus, char *path);
© All Rights Reserved