Re: [PATCH] unified frontend support for pg_malloc et al and palloc/pfree mulation (was xlogreader-v4)

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: [PATCH] unified frontend support for pg_malloc et al and palloc/pfree mulation (was xlogreader-v4)
Дата
Msg-id 20130109115646.GC5759@awork2.anarazel.de
обсуждение исходный текст
Ответ на Re: [PATCH] unified frontend support for pg_malloc et al and palloc/pfree mulation (was xlogreader-v4)  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Ответы Re: [PATCH] unified frontend support for pg_malloc et al and palloc/pfree mulation (was xlogreader-v4)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2013-01-09 13:46:53 +0200, Heikki Linnakangas wrote:
> On 09.01.2013 13:27, Andres Freund wrote:
> >- makes palloc() into a real function so CurrentMemoryContext doesn't
> >   need to be provided
>
> I don't understand the need for this change. Can't you just:
>
> #define palloc(s) pg_malloc(s)
>
> in the frontend context?

Yes, that would be possible, but imo its the inferior solution:
* it precludes ever sharing code without compiling twice
* removing allows us to get rid of the following ugliness in dirmod.c:
-#ifndef FRONTEND
-
-/*
- * On Windows, call non-macro versions of palloc; we can't reference
- * CurrentMemoryContext in this file because of PGDLLIMPORT conflict.
- */
-#if defined(WIN32) || defined(__CYGWIN__)
-#undef palloc
-#undef pstrdup
-#define palloc(sz)     pgport_palloc(sz)
-#define pstrdup(str)   pgport_pstrdup(str)
-#endif
-#else                          /* FRONTEND */
-
* it opens the window for moving more stuff from utils/palloc.h to memutils.h

Greetings,

Andres Freund

--Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Further pg_upgrade analysis for many tables
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Further pg_upgrade analysis for many tables