Re: Fix condition in shm_toc and remove unused function shm_toc_freespace.

From: Zhang Mingli <zmlpostgres(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix condition in shm_toc and remove unused function shm_toc_freespace.
Date: 2023-01-12 06:50:13
Message-ID: 70ce9710-e9ed-4a25-a327-88de830b8cf6@Spark
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Jan 12, 2023, 14:34 +0800, Zhang Mingli <zmlpostgres(at)gmail(dot)com>, wrote:
> Hi, hackers
>
> Some conditions in shm_toc_insert and shm_toc_allocate are bogus, like:
> if (toc_bytes + nbytes > total_bytes || toc_bytes + nbytes < toc_bytes)
> Remove the condition `toc_bytes + nbytes < toc_bytes` and take a sizeof(shm_entry) into account in shm_toc_allocate though
> shm_toc_allocate does that too.
  shm_toc_insert does that too, and  we can report error earlier.

Regards,
Zhang Mingli

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2023-01-12 06:50:23 Re: On login trigger: take three
Previous Message John Naylor 2023-01-12 06:44:00 Re: Small miscellaneus fixes (Part II)