Re: shm_toc_lookup API
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2017-06-05T19:10:05Z
Lists: pgsql-hackers
On 2017-06-05 15:06:06 -0400, Tom Lane wrote: > Andres Freund <andres@anarazel.de> writes: > > On 2017-06-05 14:57:10 -0400, Tom Lane wrote: > >> Meh. Without volatile, I think that the compiler would be within its > >> rights to elide the nentry local variable and re-fetch toc->toc_nentry > >> each time through the loop. > > > I don't think that's true. > > Perhaps not, but I'm not quite convinced. Anyway it doesn't matter, > at least not here. If not, we have a bunch of bugs in other files. So if there are concerns, we should better resolve them. - Andres
Commits
-
Code review for shm_toc.h/.c.
- 3e60c6f72328 10.0 landed
-
Don't be so trusting that shm_toc_lookup() will always succeed.
- d4663350646c 10.0 landed