Re: [fpc-pascal] Question about System.Move()

2021-01-27 Thread Derek Edson via fpc-pascal
Your simplified code would not be thread safe. A thread swap after the first instruction of mov (%rdi), %rax could potentially cause a problem. RAX (A) contains the pointer to the string descriptor, which includes the pointer to the actual string data and the reference count. Should "A"

Re: [fpc-pascal] Question about System.Move()

2021-01-27 Thread Benito van der Zander via fpc-pascal
Hi, Procedure ManagedMove(const source: T;var dest: T;count: SizeInt); In principle a good idea. However this is one of those cases where you'd definitely need to use constref instead of const. Or var, since the source might be cleared And perhaps there could be a special attribute