summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/til_module_context.c3
-rw-r--r--src/til_module_context.h3
2 files changed, 6 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;
}
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