Re: Setting oom_adj on linux?

From: Alex Hunsaker <badalex(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Setting oom_adj on linux?
Date: 2010-01-08 15:24:05
Message-ID: 34d269d41001080724w4e70deb4n701f549bfb727c31@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 8, 2010 at 07:53, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> Alex Hunsaker wrote:
>> On Thu, Jan 7, 2010 at 20:26, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> > Alex Hunsaker <badalex(at)gmail(dot)com> writes:

> The usual solution for this kind of thing is:
>
>        #ifdef LINUX
>        #define OOM_ADJUST oom_adjust()
>        #else
>        #define OOM_ADJUST do {} while (0)
>        #endif
>
> so there is no call or dummy function and you reference it in the code
> as:

Surely any compiler worth its salt would turn a call to an empty void
function into a noop? Then again maybe I just hate macros :)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-01-08 15:42:25 Re: RFC: PostgreSQL Add-On Network
Previous Message Kevin Grittner 2010-01-08 15:18:19 Re: Serializable Isolation without blocking