Commit 2702f7cb authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Modify [BoundedBitSet] to take advantage of [DWordBitSet] when possible.

parent 7b2c1ec9
......@@ -16,10 +16,10 @@
interval [0, n). *)
(* We select an implementation based on [n]. If [n] is less than or equal to
[AtomicBitSet.bound], then we can use an atomic bit set, which fits in a
single machine word and requires no memory allocation. Otherwise, we
fall back on [SparseBitSet], which can represent integers of unbounded
magnitude. *)
[AtomicBitSet.bound], then we can use a single-word bit set, which requires
no memory allocation. If [n] is less than or equal to [DWordBitSet.bound],
then we can use a double-word bit set. Otherwise, we fall back on
[SparseBitSet], which can represent integers of unbounded magnitude. *)
(* The functor [Make] must take a dummy argument [()] in order to indicate
that it is not an applicative functor. Otherwise, we get a cryptic type
......@@ -40,6 +40,8 @@ end) ()
include (val
if N.n <= AtomicBitSet.bound then
(module AtomicBitSet : S)
else if N.n <= DWordBitSet.bound then
(module DWordBitSet : S)
else
(module SparseBitSet : S)
: S)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment