Up

module Interned_string

: sig

Provides a functor for creating an interned string type.

An interned string is internally an int which is an index into a lookup table, which makes hashing and (non-lexicographic) comparison faster than for strings. The tradeoff is that converting an interned string to and from a string is slower, since they require table lookups instead of being no-ops.

Some notes on the implementation:

The semantics of the other operations should be the same as for String.

We don't fix the memory leak with weak pointers for performance reasons. See jane/interns/ahuq/strint/README at revision b9a2b9dbf290.

#
module Make : functor (T : sig
#
val initial_table_size : int
end
) -> sig
include Std_internal.Identifiable
#
val of_bigstring : ?pos:int -> ?len:int -> Bigstring.t -> t
end
end