Re: [PATCH] dynahash: add memory allocation failure check

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Cc: m(dot)korotkov(at)postgrespro(dot)ru, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] dynahash: add memory allocation failure check
Date: 2025-04-24 14:10:22
Message-ID: 1619050.1745503822@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrey Borodin <x4mmm(at)yandex-team(dot)ru> writes:
> While fixing this maybe use MemoryContextAllocZero() instead of subsequent MemSet()?

I thought about that but intentionally left it as-is, because that
would force zeroing of the space reserved for the hashtable name too.
That's unnecessary, and since it'd often be odd-sized it might result
in a less efficient fill loop.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Japin Li 2025-04-24 14:20:55 Re: Disallow redundant indexes
Previous Message Noah Misch 2025-04-24 14:08:50 Re: pg_upgrade-breaking release