Re: palloc unification

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndQuadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: palloc unification
Date: 2013-02-06 18:51:15
Message-ID: 20130206185115.GI4299@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane escribió:
> Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> > On 6 February 2013 14:38, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
> >> Yeah, I am doing this right now and the "shared" name doesn't seem so
> >> good. "libpgframework" sounds decent. So since libpgport comes from
> >> src/port, are we okay with src/framework and src/include/framework?
>
> > "common" ?
>
> > src/backend/common
> > src/include/common
>
> To me the term "framework" carries a lot of baggage that doesn't fit
> this usage. "common" seems better.

Okay, here's an attempt at doing it that way. Notably this creates
libpgcommon, a static library, to be used by both frontend and backend.
There's only a frontend file now (fe_memutils.c); the backend side of it
is empty. I verified that the backend makefile rules work, but there's
no attempt to link it into the backend. libpgcommon piggybacks on
libpgport: for instance there is no separate submake-pgcommon rule on
which to depend, or LDFLAGS additions and the like, I just appended it
all to existing pgport rules. Duplicating it would be much more verbose
and pointless; if we ever need to distinguish these two libs, that can
easily be done.

Some existing pg_malloc() implementations tried to do something other
than exit(EXIT_FAILURE); pg_upgrade did pg_log(FATAL) for instance. But
I don't think there is much point in that, so I've just made them all
use fprintf(stderr); exit(EXIT_FAILURE); This is the same approach
Zoltan ended up with in his patch.

MSVC is known broken (I didn't touch Andres' hunk of that. I will look
into that later.)

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
commonalize-palloc.patch text/x-diff 46.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2013-02-06 19:08:38 JSON NULLs
Previous Message Heikki Linnakangas 2013-02-06 18:47:39 Re: [COMMITTERS] pgsql: Fast promote mode skips checkpoint at end of recovery.