let gcmalloc (#a:Type0) = mgcmalloc #a #(trivial_preorder a)
let gcmalloc (#a: Type0) =
mgcmalloc #a #(trivial_preorder a)
LowStar.Buffer.fst.checked
prims.fst.checked LowStar.Monotonic.Buffer.fsti.checked FStar.UInt32.fsti.checked FStar.Seq.fst.checked FStar.Preorder.fst.checked FStar.Pervasives.fsti.checked FStar.List.Tot.fst.checked FStar.HyperStack.ST.fsti.checked FStar.HyperStack.fst.checked FStar.Ghost.fsti.checked
LowStar.Buffer.fst
LowStar.Monotonic.Buffer.mgcmalloc LowStar.Buffer.trivial_preorder FStar.Monotonic.HyperHeap.rid FStar.UInt32.t LowStar.Monotonic.Buffer.mbuffer Prims.l_and Prims.eq2 Prims.nat LowStar.Monotonic.Buffer.length FStar.UInt32.v Prims.b2t Prims.op_Negation LowStar.Monotonic.Buffer.g_is_null LowStar.Monotonic.Buffer.frameOf LowStar.Monotonic.Buffer.recallable FStar.Monotonic.HyperStack.mem FStar.HyperStack.ST.is_eternal_region Prims.op_GreaterThan LowStar.Monotonic.Buffer.live LowStar.Monotonic.Buffer.unused_in FStar.Set.equal FStar.Map.domain FStar.Monotonic.Heap.heap FStar.Monotonic.HyperStack.get_hmap FStar.Monotonic.HyperStack.get_tip LowStar.Monotonic.Buffer.modifies LowStar.Monotonic.Buffer.loc_none FStar.Seq.Base.seq LowStar.Monotonic.Buffer.as_seq FStar.Seq.Base.create
(*
   Copyright 2008-2018 Microsoft Research

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*)
module LowStar.Buffer

include LowStar.Monotonic.Buffer

module P = FStar.Preorder
module G = FStar.Ghost
module U32 = FStar.UInt32
module Seq = FStar.Seq

module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST

(*
 * Wrapper over LowStar.Monotonic.Buffer, with trivial preorders
 *   -- functions that take explicit preorder as arguments (e.g. sub etc.)
 *   -- these include allocation functions also
 *)
let trivial_preorder (a:Type0) :srel a = fun _ _ -> True

type buffer (a:Type0) = mbuffer a (trivial_preorder a) (trivial_preorder a)

unfold let null (#a:Type0) :buffer a = mnull #a #(trivial_preorder a) #(trivial_preorder a)

unfold let gsub (#a:Type0) = mgsub #a #(trivial_preorder a) #(trivial_preorder a) (trivial_preorder a)

unfold let gsub_inj (#a:Type0) = mgsub_inj #a #(trivial_preorder a) #(trivial_preorder a) (trivial_preorder a) (trivial_preorder a)

[@@unifier_hint_injective]
inline_for_extraction
type pointer (a:Type0) = b:buffer a{length b == 1}

inline_for_extraction
type pointer_or_null (a:Type0) = b:buffer a{if g_is_null b then True else length b == 1}

inline_for_extraction let sub (#a:Type0) = msub #a #(trivial_preorder a) #(trivial_preorder a) (trivial_preorder a)

inline_for_extraction let offset (#a:Type0) = moffset #a #(trivial_preorder a) #(trivial_preorder a) (trivial_preorder a)

unfold let lbuffer (a:Type0) (len:nat) = lmbuffer a (trivial_preorder a) (trivial_preorder a) len
val gcmalloc : r: FStar.Monotonic.HyperHeap.rid -> init: a -> len: FStar.UInt32.t
  -> FStar.HyperStack.ST.ST
    (b:
      (b:
        LowStar.Monotonic.Buffer.mbuffer a
          (LowStar.Buffer.trivial_preorder a)
          (LowStar.Buffer.trivial_preorder a)
          { LowStar.Monotonic.Buffer.length b == FStar.UInt32.v len /\
            Prims.op_Negation (LowStar.Monotonic.Buffer.g_is_null b) })
        {LowStar.Monotonic.Buffer.frameOf b == r /\ LowStar.Monotonic.Buffer.recallable b})
r: FStar.Monotonic.HyperHeap.rid -> init: a -> len: FStar.UInt32.t
  -> FStar.HyperStack.ST.ST
    (b:
      (b:
        LowStar.Monotonic.Buffer.mbuffer a
          (LowStar.Buffer.trivial_preorder a)
          (LowStar.Buffer.trivial_preorder a)
          { LowStar.Monotonic.Buffer.length b == FStar.UInt32.v len /\
            Prims.op_Negation (LowStar.Monotonic.Buffer.g_is_null b) })
        {LowStar.Monotonic.Buffer.frameOf b == r /\ LowStar.Monotonic.Buffer.recallable b})