aboutsummaryrefslogtreecommitdiff
path: root/src/size_policy.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/size_policy.rs')
-rw-r--r--src/size_policy.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/size_policy.rs b/src/size_policy.rs
new file mode 100644
index 0000000..7eb5c6a
--- /dev/null
+++ b/src/size_policy.rs
@@ -0,0 +1,14 @@
+/// No reason for this number as of now.
+pub const DEFAULT_INITIAL_CAPACITY: usize = 8;
+
+/// When the approximate load factor reaches `COLLECT_LOAD_FACTOR`, we remove
+/// all the expired pointers and then consider resizing.
+pub const COLLECT_LOAD_FACTOR: f32 = 0.9;
+
+/// If, after collection, the load factor is above `GROW_LOAD_FACTOR`, we grow.
+pub const GROW_LOAD_FACTOR: f32 = 0.75;
+
+/// If, after collection, the load factor is below `SHRINK_LOAD_FACTOR`, we shrink.
+pub const SHRINK_LOAD_FACTOR: f32 = 0.25;
+
+