1234567891011121314151617181920212223242526272829303132333435(**
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*)(*****************************************************************************)(* The prefix is used to guarantee that we are not mixing different kind of
* keys in the heap.
* It just creates a new prefix every time its called.
* The $ at the end of the prefix ensures that we don't have ambiguities if a key
* happens to start with a digit.
*)(*****************************************************************************)typet=stringletmake=letprefix_count=ref0infun()->incrprefix_count;string_of_int!prefix_count^"$"letmake_keyprefixk=prefix^kletremoveprefixk=letprefix_size=String.lengthprefixinassert(String.subk0prefix_size=prefix);String.subkprefix_size(String.lengthk-prefix_size)