anchor.diff:                      fs.Write(bad,0,pageSize)
                   ) blocks
   
  -        //stomp() // TODO remove
  +        //stomp() // TODO remove.  or maybe a setting?  probably not.
   
           lock critSectionNextPage (fun () ->
               // all additions to the freeBlocks list should happen here
               // by calling this function.
  +            //
  +            // the list is kept consolidated and sorted by size descending.
  +            // unfortunately this requires two sorts, and they happen here
  +            // inside a critical section.  but the benefit is considered
  +            // worth the trouble.
               
  -            // TODO policy questions here.  should freeBlocks be sorted?
  -            // how?  large blocks first, and always take the first one?
  -
               // TODO it is important that freeBlocks contains no overlaps.
               // add debug-only checks to verify?
   
  
positive.code:                 // count will always compress better as a varint.
                  List.iter (fun (t:PageBlock) -> pb.PutVarint(t.firstPage |> int64); pb.PutVarint(t.CountPages |> int64);) info.blocks
                  ) h.currentState
              // TODO is pb exactly full?
              pb.Buffer
  
          let pb = PageBuilder(HEADER_SIZE_IN_BYTES)
  
negative.code: 
  type IPendingSegment = interface end
  
  // PageBlock, struct vs. record
  // struct is a little faster and more compatible with C#
  // record is more F# idiomatic
  type PageBlock = 
  