summaryrefslogtreecommitdiff
path: root/src/til_module_context.c
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.c
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.c')
-rw-r--r--src/til_module_context.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/til_module_context.c b/src/til_module_context.c
index 5dffa73..9767d96 100644
--- a/src/til_module_context.c
+++ b/src/til_module_context.c
@@ -1,8 +1,10 @@
#include <assert.h>
#include <errno.h>
+#include <stdint.h>
#include <stdlib.h>
#include "til.h"
+#include "til_jenkins.h"
#include "til_module_context.h"
@@ -41,6 +43,7 @@ void * til_module_context_new(size_t size, unsigned seed, unsigned ticks, unsign
module_context->ticks = ticks;
module_context->n_cpus = n_cpus;
module_context->path = path;
+ module_context->path_hash = til_jenkins((uint8_t *)path, strlen(path));
return module_context;
}
© All Rights Reserved