From d0a302aff0b3da86aa32b3cfea177ec41cc6488d Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 10 Jan 2023 15:36:47 -0800 Subject: 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. --- src/til_module_context.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/til_module_context.c') 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 #include +#include #include #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; } -- cgit v1.2.1