Re: Re-thing PG_MODULE_MAGIC - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Re-thing PG_MODULE_MAGIC
Date
Msg-id 20060616141726.GA16601@svana.org
Whole thread Raw
In response to Re: Re-thing PG_MODULE_MAGIC  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Re-thing PG_MODULE_MAGIC  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Jun 16, 2006 at 02:51:41PM +0100, Simon Riggs wrote:
> On Wed, 2006-06-14 at 20:07 -0400, Tom Lane wrote:
> > Josh Berkus <josh@agliodbs.com> writes:
> > > I just noticed (the hard way) that in 8.2CVS, the PG_MODULE_MAGIC header is
> > > now *required* for all loadable modules.   This includes non-pg modules,
> > > such as Solaris' libumem (performance improvement for malloc).
> >
> > What is libumem and why are you trying to load it as a dynamic module?
>
> http://www.usenix.org/event/usenix01/full_papers/bonwick/bonwick_html/index.html

So it's a library that replaces malloc() and free() with new versions.
Does it actually help postgres, given postgres has its own memory
allocator already.

In any case, it would be fairly straightforward to make a duummy module
to wrap libumem. Create a file with just the module magic and link it
against libumem.

However, thinking about it, what they're doing can't possibly work. To
override malloc/free, you need to load the library *before* the C
library. Having the postmaster do it after startup is way too late.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Re-thing PG_MODULE_MAGIC
Next
From: Tom Lane
Date:
Subject: Re: Re-thing PG_MODULE_MAGIC