summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-08-30 09:55:24 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-30 09:55:24 -0700
commit8dbbc8c2f56e84e9cff97188dc5ad832660d3cc8 (patch)
tree5b80b4548f26d8997a4d379546452c24085c7acc /lib.h
parent4463445b017cd0099cbb0fa050d199a814505f72 (diff)
downloadtxr-8dbbc8c2f56e84e9cff97188dc5ad832660d3cc8.tar.gz
txr-8dbbc8c2f56e84e9cff97188dc5ad832660d3cc8.tar.bz2
txr-8dbbc8c2f56e84e9cff97188dc5ad832660d3cc8.zip
struct: 4-way set associative slot caches.
* lib.h (SLOT_CACHE_SIZE): Adjust value from 32 to 8. (slot_cache_entry_t): New struct typedef. (slot_cache_line_t): Typedef updated: a cache line consists of cache line entry structs rather than cnums. * struct.c (cacheline_lookup, cacheline_insert): New static functions. (lookup_slot): Use cacheline_lookup and cacheline_insert.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib.h b/lib.h
index f8331b4e..93a2b446 100644
--- a/lib.h
+++ b/lib.h
@@ -99,10 +99,14 @@ struct string {
val alloc;
};
-#define SLOT_CACHE_SIZE 32
+#define SLOT_CACHE_SIZE 8
-typedef cnum slot_cache_line_t[2];
-typedef slot_cache_line_t *slot_cache_t;
+typedef struct {
+ cnum id;
+ cnum slot;
+} slot_cache_entry_t;
+typedef slot_cache_entry_t slot_cache_set_t[4];
+typedef slot_cache_set_t *slot_cache_t;
struct sym {
obj_common;