RE: [bug fix] ECPG: freeing memory for pgtypes crashes on Windows

From: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
To: 'Thomas Munro' <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "Michael Meskes (meskes(at)postgresql(dot)org)" <meskes(at)postgresql(dot)org>
Subject: RE: [bug fix] ECPG: freeing memory for pgtypes crashes on Windows
Date: 2018-02-05 00:53:47
Message-ID: 0A3221C70F24FB45833433255569204D1F8AE06B@G01JPEXMBYT05
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: Thomas Munro [mailto:thomas(dot)munro(at)enterprisedb(dot)com]
> +#ifndef PGTYPES_FREE
> +#define PGTYPES_FREE
> + extern void PGTYPES_free(void *ptr);
> +#endif
>
> It seems quite strange to repeat this in pgtypes_date.h, pgtypes_interval.h
> and pgtypes_numeric.h. I guess you might not want to introduce a new common
> header file so that his can be back-patched more easily? Not sure if there
> is a project policy about that, but it seems unfortunate to introduce
> maintenance burden by duplicating this.

Your guess is correct. I wanted to avoid the duplication, but there was no good place to put this without requiring existing applications to change their #include directives.

> + <function>PGTYPES_free()/<function> instead of
> <function>free()</function>.
>
> The "/" needs to move inside then closing tag.

Thanks, fixed.

Regards
Takayuki Tsunakawa

Attachment Content-Type Size
pgtypes_freemem_v2.patch application/octet-stream 39.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yoshimi Ichiyanagi 2018-02-05 00:59:25 Re: [HACKERS][PATCH] Applying PMDK to WAL operations for persistent memory
Previous Message Amit Langote 2018-02-05 00:35:40 Re: [HACKERS] Adding column_constraint description in ALTER TABLE synopsis