From: David Steele <david@pgmasters.net>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: pgbench stats per script & other stuff
Date: Tue, 15 Mar 2016 14:41:37 -0400
Message-ID: <56E85761.3030105@pgmasters.net> (raw)
In-Reply-To: <alpine.DEB.2.10.1603041943110.11128@sto>
References: <20160304184157.GA726930@alvherre.pgsql>
<alpine.DEB.2.10.1603041943110.11128@sto>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 3/4/16 1:53 PM, Fabien COELHO wrote:
>>> That is why the "fs" variable in process_file is declared "static",
>>> and why
>>> I wrote "some hidden awkwarness".
>>>
>>> I did want to avoid a malloc because then who would free the struct?
>>> addScript cannot to it systematically because builtins are static. Or it
>>> would have to create an on purpose struct, but I then that would be more
>>> awkwarness, and malloc/free to pass arguments between functions is not
>>> efficient nor very elegant.
>>>
>>> So the "static" option looked like the simplest & most elegant version.
>>
>> Surely that trick breaks if you have more than one -f switch, no? Oh, I
>> see what you're doing: you only use the command list, which is
>> allocated, so it doesn't matter that the rest of the struct changes
>> later.
>
> The two fields that matter (desc and commands) are really copied into
> sql_scripts, so what stays in the is overriden if used another time.
>
>> I'm not concerned about freeing the struct; what's the problem with it
>> surviving until the program terminates?
>
> It is not referenced anywhere so it is a memory leak.
>
>> If somebody specifies thousands of -f switches, they will waste a few
>> bytes with each, but I'm hardly concerned about a few dozen kilobytes
>> there ...
>
> Ok, so you prefer a memory leak. I hate it on principle.
>
> Here is a v23 with a memory leak anyway.
Álvaro, it looks like you've been both reviewer and committer on this
work for some time.
The latest patch seems to address you final concern. Can I mark it
"ready for committer"?
--
-David
david@pgmasters.net
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: david@pgmasters.net, alvherre@2ndquadrant.com, coelho@cri.ensmp.fr, michael.paquier@gmail.com
Subject: Re: pgbench stats per script & other stuff
In-Reply-To: <56E85761.3030105@pgmasters.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox