Re: [HACKERS] What is the posix_memalign() equivalent for the PostgreSQL?

2016-09-14 Thread Robert Haas
On Fri, Sep 2, 2016 at 1:17 PM, Andres Freund wrote: > On 2016-09-02 13:05:37 -0400, Tom Lane wrote: >> Anderson Carniel writes: >> > If not, according to your experience, is there a >> > significance difference between the performance of the O_DIRECT or not? >> >> AFAIK, nobody's really bothered

Re: [HACKERS] What is the posix_memalign() equivalent for the PostgreSQL?

2016-09-02 Thread Andres Freund
On 2016-09-02 13:05:37 -0400, Tom Lane wrote: > Anderson Carniel writes: > > If not, according to your experience, is there a > > significance difference between the performance of the O_DIRECT or not? > > AFAIK, nobody's really bothered to measure whether that would be useful > for Postgres. Th

Re: [HACKERS] What is the posix_memalign() equivalent for the PostgreSQL?

2016-09-02 Thread Tom Lane
Anderson Carniel writes: > I would like to know if the PostgreSQL provides a memory function that > allocates aligned memory. Not beyond MAXALIGN (although the shared-memory alloc functions do align to cacheline boundaries IIRC). > If not, according to your experience, is there a > significance

Re: [HACKERS] What is the posix_memalign() equivalent for the PostgreSQL?

2016-09-02 Thread Anderson Carniel
The unexpected errors are problems to free the memory that was previously allocated with posix_memalign. After a number of memory allocation and free calls, the next free call crashes the system. On the other hand, if I replace the posix_memalign and the free calls for the following malloc/free al

Re: [HACKERS] What is the posix_memalign() equivalent for the PostgreSQL?

2016-09-02 Thread Craig Ringer
On 2 September 2016 at 01:12, Anderson Carniel wrote: > Dear all, > > I am developing an extension for the PostgreSQL that write/read some > external files from the PostgreSQL. In order to write/read, I am using the > O_DIRECT flag and using the posix_memalign to allocate memory. I would like > to

[HACKERS] What is the posix_memalign() equivalent for the PostgreSQL?

2016-09-01 Thread Anderson Carniel
Dear all, I am developing an extension for the PostgreSQL that write/read some external files from the PostgreSQL. In order to write/read, I am using the O_DIRECT flag and using the posix_memalign to allocate memory. I would like to know if the postgresql internal library provides an equivalent fu