On 03/09/2020 17:44, Martin Frb via fpc-pascal wrote:
type
  TMyData = class
      FData: array of byte;
   end;
  TMyThreadedQueue = specialize TLazThreadedQueue<TMyData>;

Of course you can do
  TMyData = array of byte;  // or record .... end if you want
  TMyThreadedQueue = specialize TLazThreadedQueue<TMyData>;

Keep in mind, that if you push an array (or anything containing an array), you push a reference.

That is any modification you make to the array content after you pushed, will modify the date in the queue. (reference to the same data)

To prevent that you must ensure the data has only one reference holder.
See SetLength
https://www.freepascal.org/docs-html/rtl/system/setlength.html
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to