Re: repeat() function, CHECK_FOR_INTERRUPTS(), and unlikely()
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Joe Conway <mail@joeconway.com>, PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Date: 2020-05-27T07:29:27Z
Lists: pgsql-hackers
On Mon, May 25, 2020 at 11:14:39AM -0400, Tom Lane wrote: > Perhaps I'm an optimist, but I think that eventually we will figure out > how to make unlikely() work for MSVC. In the meantime we might as well > let it work for gcc-on-Windows builds. I am less optimistic than that, but there is hope. This was mentioned as something considered for implementation in April 2019: https://developercommunity.visualstudio.com/idea/488669/please-add-likelyunlikely-builtins.html > I think that each of those tests should have a separate unlikely() marker, > since the whole point here is that we don't expect either of those tests > to yield true in the huge majority of CHECK_FOR_INTERRUPTS executions. +1. I am not sure that the addition of unlikely() should be backpatched though, that's not something usually done. -- Michael
Commits
-
Add unlikely() to CHECK_FOR_INTERRUPTS()
- c5262cfd59cb 10.14 landed
- 3cbf4be3e0eb 11.9 landed
- 8401ad52350e 12.4 landed
- 87fb04af1e70 13.0 landed
-
Add CHECK_FOR_INTERRUPTS() to the repeat() function
- 36758c472ea7 11.9 landed
- 3ccae5445cc8 12.4 landed
- 887cdff4dcbd 13.0 landed
- bfb9595a786e 9.5.23 landed
- 28e2c6eacc69 9.6.19 landed
- 2cbe3a954219 10.14 landed