[php-src] PR #17482: Replace __forceinline with zend_always_inline in win32/
| From: | cmb69 | Date: | Wed, 15 Jan 2025 23:45:38 +0000 |
| Subject: | [php-src] PR #17482: Replace __forceinline with zend_always_inline in win32/ | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-30407@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/17482
Author: cmb69
__forceinline is MSVC specific (and also understood by Clang on Windows), but the code
in win32/ should not be constrained to these compilers. Since we already have
zend_always_inline, we use this instead.
---
The motivation is to make the win32/ more portable, since there are other relevant compilers than
MSVC and Clang on Windows (e.g. MinGW GCC). While this commit doesn't really change anything in
this regard, it makes it simpler to do so.
Note that I have deliberately not touched some bundled libraries using __forceinline,
because it may make updating these a bit harder, and more importantly, because they already use
__forceinline only if _MSC_VER is defined.
Also note that I consider the use of zend_always_inline generally doubtful, because it
(a) does not necessarily enforce inlining (what might easily be overlooked), and (b) the programmer
doesn't know better than the compiler (maybe for some tiny amount of time, but the next
commit/compiler version may make that moot; profile guided optimization is likely the better judge).
We should probably have a look at our uses of __inline which appear to be outdated.