Skip to content

Commit 158181f

Browse files
authored
ext/pcntl: pcntl_sigprocmask/pcntl_getcpuaffinity to packed arrays. (php#18369)
1 parent b385e0d commit 158181f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ext/pcntl/pcntl.c

+2
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,7 @@ PHP_FUNCTION(pcntl_sigprocmask)
956956
RETURN_THROWS();
957957
}
958958

959+
zend_hash_real_init_packed(Z_ARRVAL_P(user_old_set));
959960
for (unsigned int signal_no = 1; signal_no < PCNTL_G(num_signals); ++signal_no) {
960961
if (sigismember(&old_set, signal_no) != 1) {
961962
continue;
@@ -1680,6 +1681,7 @@ PHP_FUNCTION(pcntl_getcpuaffinity)
16801681

16811682
zend_ulong maxcpus = (zend_ulong)sysconf(_SC_NPROCESSORS_CONF);
16821683
array_init(return_value);
1684+
zend_hash_real_init_packed(Z_ARRVAL_P(return_value));
16831685

16841686
for (zend_ulong i = 0; i < maxcpus; i ++) {
16851687
if (PCNTL_CPU_ISSET(i, mask)) {

0 commit comments

Comments
 (0)