Re: [PATCH] Use MAP_HUGETLB where supported (v3)

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: [PATCH] Use MAP_HUGETLB where supported (v3)
Дата
Msg-id 52E95857.30503@vmware.com
обсуждение исходный текст
Ответ на Re: [PATCH] Use MAP_HUGETLB where supported (v3)  (Christian Kruse <christian@2ndquadrant.com>)
Ответы Re: [PATCH] Use MAP_HUGETLB where supported (v3)  (Christian Kruse <christian@2ndquadrant.com>)
Список pgsql-hackers
On 01/29/2014 09:18 PM, Christian Kruse wrote:
> Hi,
>
> On 29/01/14 10:11, Jeff Janes wrote:
>> I'm getting this warning now with gcc (GCC) 4.4.7:
>
> Interesting. I don't get that warning. But the compiler is (formally)
> right.
>
>> pg_shmem.c: In function 'PGSharedMemoryCreate':
>> pg_shmem.c:332: warning: 'allocsize' may be used uninitialized in this
>> function
>> pg_shmem.c:332: note: 'allocsize' was declared here

Hmm, I didn't get that warning either.

> Attached patch should fix that.

That's not quite right. If the first mmap() fails, allocsize is set to 
the rounded-up size, but the second mmap() uses the original size for 
the allocation. So it returns a too high value to the caller.

Ugh, it's actually broken anyway :-(. The first allocation also passes 
*size to mmap(), so the calculated rounded-up allocsize value is not 
used for anything.

Fix pushed.

- Heikki



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Vik Fearing
Дата:
Сообщение: Re: pg_sleep_enhancements.patch
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: pg_sleep_enhancements.patch