Why do you want to pass the record instead of the pointer?

The pointer is valid during the entire call (inside Append).

Append does not store the pointer, but a copy of the data. So this is save.


Passing the pointer saves the need to pass the entire record by value (or in other word, to make a mem copy (or registers) of the entire record) when passing to the function. Which would meant that the data would be copied twice, as it is once copied in inside the Append function anyway.

The param could be const/constref instead of pointer. But as the argument is already pointer, why?

Please mail how to get the mem leak, and why this fixes it.


On 22/11/2014 06:14, Flávio Etrusco wrote:
On Fri, Nov 21, 2014 at 10:33 PM, Mattias Gaertner
<nc-gaert...@netcologne.de> wrote:
On Fri, 21 Nov 2014 23:51:13 +0100
Mattias Gaertner <nc-gaert...@netcologne.de> wrote:

(...)
Without the AVs you can see the mem leaks. I fixed the three mem leaks.
Here's a patch to change the Append method, just in case ;-)

Best regards,
Flávio


--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to