summaryrefslogtreecommitdiff
path: root/gui/util.h
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-26 03:39:28 -0400
committerbd <bdunahu@operationnull.com>2025-04-26 03:39:28 -0400
commita78163745b43a0c420ae4ea5792def30a94420eb (patch)
tree9cc23cfec1a7e524822d604e95e237034b31a95e /gui/util.h
parentc98a0c26c4ccb5c4ae0e9f5810be910a7b299037 (diff)
Partial cache size generation, full cache display
Diffstat (limited to 'gui/util.h')
-rw-r--r--gui/util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gui/util.h b/gui/util.h
new file mode 100644
index 0000000..87c33f6
--- /dev/null
+++ b/gui/util.h
@@ -0,0 +1,8 @@
+/**
+ * Given `total_levels', returns an integer between 4 and 12 which is a linear map of `level' onto `total_levels'.
+ * This is used for generating cache sizes given a number of levels.
+ * @param the total number of cache levels, zero-indexed.
+ * @param a numberedcache level, zero-indexed.
+ * @return an integer between 4-12, linearly scaled with level.
+ */
+int cache_size_mapper(int total_levels, int level);