Split the kernel-land cache into 2 separate caches, one for the root
volume and one for secondary volumes. When an unmount happens, clear
the non-root cache to ensure no overlap with filesystem IDs.
OSDictionary is not well-suited to our needs and locking is quite expensive.
This commit:
+ Replaces all uses of OSDictionary with a new SantaCache class, which
is a size-limited array hash table with per-bucket locking. It works with
uint64_t keys, which is perfect for our needs.
+ Adds a unit test for SantaCache.
+ Removes SantaCachedDecision and SantaPIDAndPPID, which only existed
because OSDictionary can only store OSObject subclasses.
+ Removes a lot of locking logic from SantaDecisionManager as the
locking is now handled inside SantaCache and is therefore and is
much more granular.
+ Removes the timed cache expiration for ALLOW decisions. This was
originally to ensure executions were logged regularly but as we're
logging all executions nowadays this is longer particularly useful.
SantaCache's configured load factor and hashing function may need tweaking
over-time but this is already a little faster and uses less memory
than what existed before.