anchor.diff:              case {size(Data) div 8, ref_data_size(Kind)} of
                   {Size, RefSize} when Size >= RefSize ->
                       Ref1 = alloc_data(Size, Ref#ref{ kind=Kind }),
  -                    ok = set_segment(<<Data:Size/binary-unit:64>>, Ref1),
  +                    ok = write(<<Data:Size/binary-unit:64>>, Ref1),
                       Ref1
               end
       end.
  
positive.code: list_element_size(pointer) -> 64;
  list_element_size(inlineComposite) -> inlineComposite.
  
  get_segment(Len, #ref{ segment=SegmentId, pos=Pos,
                         offset=Offset, data=Data }) ->
      ecapnp_data:get_segment(SegmentId, Pos + 1 + Offset, Len, Data).
  
  set_segment(Value, #ref{ segment=SegmentId, pos=Pos,
                           offset=Offset, data=Data }) ->
      ecapnp_data:update_segment({SegmentId, Pos + 1 + Offset}, Value, Data).
  
  write(#ref{ pos=-1 }) -> ok;
  write(#ref{ offset=Offset }=Ref) ->
      write(create_ptr(Offset, Ref), 0, Ref).
  
  write(Bin, #ref{ offset=Offset }=Ref) ->
      write(Bin, Offset + 1, Ref).
  
  write(Bin, Offset, #ref{ segment=SegmentId, pos=Pos, data=Data }) ->
      ecapnp_data:update_segment({SegmentId, Pos + Offset}, Bin, Data).
  
  check_ptr(#ref{ segment=SegmentId, pos=Ptr, data=Data },
            #ref{ segment=SegmentId, pos=Pos, data=Data, offset=Offset,
  
negative.code:         _ ->
              ElementSize = list_element_size(Size),
              Len = 1 + (((ElementSize * Count) - 1) div 64),
              {Ref, Len, [read(Len, Ref)]}
      end.
  
  flatten_ref_copy({Ref, Len, Copy}) ->
  