php-src/ext
Tim Düsterhus 06569bbd04
random: Clean Up the Mt19937 state struct (#13577)
* random: Make Mt19937's `mode` field an enum

* random: Reorder the `php_random_status_state_mt19937` struct

Empirical testing did not show any differences in performance, but it makes
sense to me to put the `count` field (which is accessed for every invocation of
Mt19937) at the beginning of the struct, keeping it near the values from the
state array that are returned first, resulting in only a single cache line load
if only a small amount of numbers are requested.

It naturally follows to also put the `mode` field there and move the
humongous state array to the end.

* random: Remove the `MT_N` constant

`MT_N` is an awfully generic name that bleeds into every file including
`php_random.h`. As it's an implementation detail, remove it entirely to keep
`php_random.h` clean.

To prevent the state struct from diverging from the implementation, the size of
the state vector is statically verified. Furthermore there are phpt tests
verifying the Mt19937 output across a reload, revealing when the state vector
is reloaded too early or too late.
2024-03-04 19:51:01 +01:00
..
bcmath Do not generate frameless info items when func info generation is disabled 2024-02-18 11:39:00 +01:00
bz2 Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
calendar Do not generate frameless info items when func info generation is disabled 2024-02-18 11:39:00 +01:00
com_dotnet Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
ctype Do not generate frameless info items when func info generation is disabled 2024-02-18 11:39:00 +01:00
curl ext/curl: Add feature_info assoc array to curl_version() (#13439) 2024-02-21 00:46:22 +00:00
date Fixed int32 underflow on DateTime::createFromTimestamp (#12775) 2024-02-27 14:01:49 +00:00
dba Do not generate frameless info items when func info generation is disabled 2024-02-18 11:39:00 +01:00
dl_test Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
dom Merge branch 'PHP-8.3' 2024-02-26 19:44:52 +01:00
enchant Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
exif Do not generate frameless info items when func info generation is disabled 2024-02-18 11:39:00 +01:00
ffi Check FFI_* ABI with Autoconf AC_CHECK_DECL (#13552) 2024-03-01 19:31:55 +01:00
fileinfo Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
filter Do not generate frameless info items when func info generation is disabled 2024-02-18 11:39:00 +01:00
ftp Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
gd Merge branch 'PHP-8.2' into PHP-8.3 2024-02-26 14:00:08 +01:00
gettext Merge branch 'PHP-8.3' 2024-03-04 15:37:24 +00:00
gmp Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
hash Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
iconv Do not generate frameless info items when func info generation is disabled 2024-02-18 11:39:00 +01:00
intl ext/intl: Refactor ResourceBundle get and dimension access (#13503) 2024-02-26 17:03:17 +00:00
json Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
ldap Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
libxml Add LIBXML_RECOVER (#13504) 2024-02-25 21:03:37 +01:00
mbstring [skip ci] Sync file permissions in Git repository 2024-02-20 17:58:47 +01:00
mysqli Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
mysqlnd Fixed handshake response charset. (#13470) 2024-03-04 21:53:52 +09:00
odbc Sync logical operators in shell scripting code (#13560) 2024-03-01 20:40:16 +01:00
opcache Add missing memfd_create Autoconf check for bundled pcre2lib (#13561) 2024-03-01 17:17:28 +01:00
openssl Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
pcntl Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
pcre Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
pdo Minor PDO conditions cleanup (#13584) 2024-03-04 17:36:51 +01:00
pdo_dblib Do not generate frameless info items when func info generation is disabled 2024-02-18 11:39:00 +01:00
pdo_firebird Do not generate frameless info items when func info generation is disabled 2024-02-18 11:39:00 +01:00
pdo_mysql Merge branch 'PHP-8.3' 2024-02-29 08:49:53 +09:00
pdo_odbc Do not generate frameless info items when func info generation is disabled 2024-02-18 11:39:00 +01:00
pdo_pgsql Sync logical operators in shell scripting code (#13560) 2024-03-01 20:40:16 +01:00
pdo_sqlite Merge branch 'PHP-8.3' 2024-02-27 15:32:20 +00:00
pgsql Sync logical operators in shell scripting code (#13560) 2024-03-01 20:40:16 +01:00
phar Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
posix Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
random random: Clean Up the Mt19937 state struct (#13577) 2024-03-04 19:51:01 +01:00
readline Do not generate frameless info items when func info generation is disabled 2024-02-18 11:39:00 +01:00
reflection Merge branch 'PHP-8.3' 2024-02-27 21:49:47 +01:00
session session: Stop using php_combined_lcg() 2024-03-02 11:29:15 +00:00
shmop Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
simplexml Add LIBXML_RECOVER (#13504) 2024-02-25 21:03:37 +01:00
skeleton Do not generate frameless info items when func info generation is disabled 2024-02-18 11:39:00 +01:00
snmp Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
soap Rename HAVE_PHP_SOAP symbol on Windows ext/soap (#13426) 2024-02-18 18:01:12 +01:00
sockets Use preprocessor to check for AI_V4MAPPED, AI_ALL and AI_IDN (#13513) 2024-02-26 16:38:00 +01:00
sodium Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
spl ext/spl: mark all zend_object_handlers as static (#13547) 2024-02-28 15:31:28 +00:00
sqlite3 Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
standard Merge branch 'PHP-8.3' 2024-03-04 21:30:58 +09:00
sysvmsg Do not generate frameless info items when func info generation is disabled 2024-02-18 11:39:00 +01:00
sysvsem Refactor union semun in ext/sysvsem (#13473) 2024-02-22 15:48:12 +01:00
sysvshm Do not generate frameless info items when func info generation is disabled 2024-02-18 11:39:00 +01:00
tidy Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
tokenizer Do not generate frameless info items when func info generation is disabled 2024-02-18 11:39:00 +01:00
xml Merge branch 'PHP-8.3' 2024-02-27 21:49:47 +01:00
xmlreader Use string literal equality helper function in xmlreader_get_method 2024-02-25 16:25:52 +01:00
xmlwriter Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
xsl Document xsl:keys handling better in ext/xsl 2024-02-24 21:31:01 +01:00
zend_test Drop zend_mm_set_custom_debug_handlers() (#13457) 2024-02-26 14:04:33 +01:00
zip Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
zlib Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
ext_skel.php