Re: Re-thing PG_MODULE_MAGIC

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Re-thing PG_MODULE_MAGIC
Дата
Msg-id 20060616141726.GA16601@svana.org
обсуждение исходный текст
Ответ на Re: Re-thing PG_MODULE_MAGIC  (Simon Riggs <simon@2ndquadrant.com>)
Ответы Re: Re-thing PG_MODULE_MAGIC  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Re-thing PG_MODULE_MAGIC
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re-thing PG_MODULE_MAGIC