Re: [fpc-devel] Memory leak: bug ot as designed?

2023-03-29 Thread Bart via fpc-devel
On Wed, Mar 29, 2023 at 11:43 PM Bart wrote: > I'll report it in the bugtracker. https://gitlab.com/freepascal.org/fpc/source/-/issues/40225 I condensed the program even further. Just concatenating 2 strings in Foo and assigning them to S will be enough to trigger the memory leak. -- Bart ___

Re: [fpc-devel] Memory leak: bug ot as designed?

2023-03-29 Thread Bart via fpc-devel
On Wed, Mar 29, 2023 at 11:44 AM Ondrej Pokorny via fpc-devel wrote: > > FYI: Delphi doesn't create a memory leak. > The memory leak seems to be related to string concatenation in the getter for the Text property. A getter like this is enough to get the leak: function TBar.GetTextStr: String; beg

Re: [fpc-devel] Help with inline assembler code

2023-03-29 Thread Jeppe Johansen via fpc-devel
Hi, A much more deterministic version would do it as this: function HiInteger(value: LongInt): LongInt; nostackframe; assembler; asm   mov r0, r0, asr #16 end; If you do it with an inline ASM block and without stackframes it becomes much harder to predict how you need to address variables by n

[fpc-devel] Help with inline assembler code

2023-03-29 Thread Paul Renaud via fpc-devel
Hello,  I've been having a problem getting some code to compile.  I've gone through the documentation, butthere isn't any specific info for the arm version. This is a simplified version Program Test;     Function HiInteger( Value: LongInt ): LongInt;     Begin   Asm     LdR R0, Value   

Re: [fpc-devel] Memory leak: bug ot as designed?

2023-03-29 Thread Ondrej Pokorny via fpc-devel
Nice one :) I am also interested in the answer. IMO it is a bug because the code is valid - https://www.freepascal.org/docs-html/ref/refse10.html FYI: Delphi doesn't create a memory leak. Ondrej ___ fpc-devel maillist - fpc-devel@lists.freepascal.o