anchor.diff:      ].
   
   -endif.
  -
  -convert({lpdb, Msgs, Max, LossStart, LossCount}) ->
  -    #lpdb{messages=Msgs,
  -          max_size=Max,
  -          size=queue:len(Msgs),
  -          loss_start=LossStart,
  -          loss_count=LossCount}.
  
positive.code: -endif.
  
  -spec lost(buf()) -> non_neg_integer().
  lost(#lpdb{loss_count=N}) -> N;
  lost(Buf = ?OLDBUF) -> lost(convert(Buf)).
  
  -spec to_pkts(buf(), IdealBytes::pos_integer(),
                framing_fun()) ->
  
negative.code: to_pkts(Buf = #lpdb{},
          Bytes, Fun) when is_integer(Bytes),
                           is_function(Fun, 1) ->
      to_pkts(Buf, Bytes, Bytes, Fun).
  
  to_pkts(Buf, BytesTotal, BytesRemaining, Fun)
    when BytesRemaining > 0 ->
  