Re: Safe memory allocation functions - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Safe memory allocation functions
Date
Msg-id CAB7nPqR4K=CLiYs__JzVUV6Q_dE9Y0xPYSgDBDdhEcxMBXtGCg@mail.gmail.com
Whole thread Raw
In response to Re: Safe memory allocation functions  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Sat, Jan 31, 2015 at 2:58 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> Committed.  I didn't think we really need to expose two separate flags
> for the aligned and unaligned cases, so I ripped that out.  I also
> removed the duplicate documentation of the new constants in the
> function header; having two copies of the documentation, one far
> removed from the constants themselves, is a recipe for them eventually
> getting out of sync.  I also moved the function to what I thought was
> a more logical place in the file, and rearranged the order of tests
> slightly so that, in the common path, we test only whether ret == NULL
> and not anything else.
Thanks a lot!

I have reworked a bit the module used for the tests of the new
extended routine (with new tests for Alloc, AllocZero and AllocHuge as
well) and pushed it here:
https://github.com/michaelpq/pg_plugins/tree/master/mcxtalloc_test
This is just to mention it for the sake of the archives, I cannot
really believe that it should be an in-core module in src/test/modules
as it does allocations of 1GB in environments where there is enough
memory. Note that it contains regression tests with alternate outputs
depending on the environment where they are run (still output may not
be stable depending on where those tests are run, particularly where
memory usage varies a lot).
-- 
Michael



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Re: Overhauling our interrupt handling (was Escaping from blocked send() reprised.)
Next
From: Andres Freund
Date:
Subject: Re: Streaming replication and WAL archive interactions