History log of /php-src/ext/ffi/ffi.c (Results 1 – 25 of 213)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 888eb370 14-Sep-2024 Peter Kokot

Fix -Wundef/C4668 warnings (#15853)

- ZTS is either undefined or defined (to 1)
- PHP_WIN32 is either undefined or defined (to 1)
- HAVE_LIBEDIT is either undefined or defined (to 1)


# 25d76162 06-Sep-2024 Bob Weinand

Make internal run_time_cache a persistent allocation (#15040)

We also add zend_map_ptr_static, so that we do not incur the overhead of constantly recreating the internal run_time_cache point

Make internal run_time_cache a persistent allocation (#15040)

We also add zend_map_ptr_static, so that we do not incur the overhead of constantly recreating the internal run_time_cache pointers on each request.
This mechanism might be extended for mutable_data of internal classes too.

show more ...


# 58aa6fc8 19-May-2023 Arnaud Le Blanc

Lazy objects

RFC: https://wiki.php.net/rfc/lazy-objects

Closes GH-15019


# c0de7214 05-Jul-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-14286 (ffi enum type (when enum has no name) make memory leak)

For top-level anonymous type definition we never store the declaration anywhere
else nor the type anywhere else.

Fix GH-14286 (ffi enum type (when enum has no name) make memory leak)

For top-level anonymous type definition we never store the declaration anywhere
else nor the type anywhere else.
The declaration keeps owning the type and it goes out of scope.
For anonymous fields this gets handled by the add_anonymous_field code that
removes the type from the declaration.
This patch does something similar in the parsing code when it is
detected we're dealing with an anonymous enum in a top-level declaration.

Closes GH-14839.

show more ...


# ebd1a366 13-May-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-14215: Cannot use FFI::load on CRLF header file with apache2handler

Some modules may reset _fmode, which causes mangling of line endings.
Always be explicit like we do in other pl

Fix GH-14215: Cannot use FFI::load on CRLF header file with apache2handler

Some modules may reset _fmode, which causes mangling of line endings.
Always be explicit like we do in other places where the native open call
is used.

Closes GH-14218.

show more ...


# 8aec95e2 04-May-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix build on Clang 18 (#14136)

Clang 18 only allows counted_by to work on real flexible array members,
not ones with a zero size. Otherwise you get errors like:
```
ext/opcache/j

Fix build on Clang 18 (#14136)

Clang 18 only allows counted_by to work on real flexible array members,
not ones with a zero size. Otherwise you get errors like:
```
ext/opcache/jit/zend_jit_ir.c:149:12: error: 'counted_by' only applies to C99 flexible array members
```

show more ...


# 18d70db0 27-Mar-2024 Cristian Rodríguez

Fix gcc-14 Wcalloc-transposed-args warnings

gcc-14 and later warns of inverted arguments in calloc or
calloc-like __alloc_size__ annotated functions.

Closes GH-13818.


# f2e199e8 25-Feb-2024 Máté Kocsis

Implement "support doc comments for internal classes and functions" (#13266)

Fixes #13130


# 97267215 10-Jan-2024 David CARLIER

general signatures discrepencies fixes (#13122)


# 927adfb1 20-Dec-2023 Cristian Rodríguez

Use a single version of mempcpy(3) (#12257)

While __php_mempcpy is only used by ext/standard/crypt_sha*, the
mempcpy "pattern" is used everywhere.

This commit removes __php_memp

Use a single version of mempcpy(3) (#12257)

While __php_mempcpy is only used by ext/standard/crypt_sha*, the
mempcpy "pattern" is used everywhere.

This commit removes __php_mempcpy, adds zend_mempcpy and transforms
open-coded parts into function calls.

show more ...


# c727f299 08-Dec-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-12905: FFI::new interacts badly with observers

Because these functions are copied and not properly registered (which we
can't), the observer code doesn't add the temporaries on st

Fix GH-12905: FFI::new interacts badly with observers

Because these functions are copied and not properly registered (which we
can't), the observer code doesn't add the temporaries on startup.
Add them via a callback during startup.

Closes GH-12906.

show more ...


# 40ccc8ea 10-Dec-2023 Jakub Zelenka

Fix GH-9698: stream_wrapper_register crashes with FFI\CData provided as class

Closes GH-12926


# adaf7263 22-Nov-2023 Dmitry Stogov

Fixed regression introduced by https://github.com/php/php-src/pull/9601


# cc2bf119 13-Nov-2023 David CARLIER

zend: introducing ZEND_ELEMENT_COUNT for struct's dynamic arrays. (#12650)

zend: introducing ZEND_ELEMENT_COUNT for struct's dynamic and flexible arrays.

It is mostly for ubsan and

zend: introducing ZEND_ELEMENT_COUNT for struct's dynamic arrays. (#12650)

zend: introducing ZEND_ELEMENT_COUNT for struct's dynamic and flexible arrays.

It is mostly for ubsan and helping array bound checking.

show more ...


# 04b35a44 28-Oct-2023 sji

Fix segfault caused by weak references to FFI objects (#12488)

Thank you!


# 692cea5c 13-Sep-2023 Ilija Tovilo

Use zend_error_noreturn for E_ERROR consistently

To be clear, these already don't return. zend_error_noreturn just hints at this
fact through the ZEND_NORETURN attribute.

Closes

Use zend_error_noreturn for E_ERROR consistently

To be clear, these already don't return. zend_error_noreturn just hints at this
fact through the ZEND_NORETURN attribute.

Closes GH-12204

show more ...


# 0b9702c9 10-Aug-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Implement GH-11934: Allow to pass CData into struct and/or union fields

Co-authored-by: KapitanOczywisty <44417092+KapitanOczywisty@users.noreply.github.com>

Closes GH-11935.


# ac99f730 21-Jul-2023 Ilija Tovilo

Fix merge conflict

Sorry...


# 11d6bea9 20-Jul-2023 Ilija Tovilo

Fix leaking definitions on FFI::cdef()->new()

Previously, FFI_G(symbols) and FFI_G(tags) were never cleaned up when calling
new on an existing object. However, if cdef() is called withou

Fix leaking definitions on FFI::cdef()->new()

Previously, FFI_G(symbols) and FFI_G(tags) were never cleaned up when calling
new on an existing object. However, if cdef() is called without parameters these
globals are NULL and might be created when new() creates new definitions. These
would then be discarded without freeing them.

Closes GH-11751

show more ...


# 4acf0084 01-Jul-2023 Máté Kocsis

Deprecate calling FFI::cast(), FFI::new(), and FFI::type() statically


# d5c649b3 23-Feb-2023 Max Kellermann

zend_compiler, ...: use `uint8_t` instead of `zend_uchar` (#10621)

`zend_uchar` suggests that the value is an ASCII character, but here,
it's about very small integers. This is misleadi

zend_compiler, ...: use `uint8_t` instead of `zend_uchar` (#10621)

`zend_uchar` suggests that the value is an ASCII character, but here,
it's about very small integers. This is misleading, so let's use a
C99 integer instead.

On all architectures currently supported by PHP, `zend_uchar` and
`uint8_t` are identical. This change is only about code readability.

show more ...


# d46dea16 18-Feb-2023 Max Kellermann

Make globals const (part 2) (#10610)

* Zend/zend_enum: make `forbidden_methods` static+const

* main/php_syslog: make `xdigits` static

* sapi/fpm: make several globals `cons

Make globals const (part 2) (#10610)

* Zend/zend_enum: make `forbidden_methods` static+const

* main/php_syslog: make `xdigits` static

* sapi/fpm: make several globals `const`

* sapi/phpdbg: make `OPTIONS` static

* sapi/phpdbg/help: make help texts const

* sapi/cli: make `template_map` const

* ext/ffi: make `zend_ffi_types` static

* ext/bcmath: make `ref_str` const

* ext/phar: make several globals static+const

show more ...


# 851e4623 13-Feb-2023 Dmitry Stogov

Make C functions returning "void" to return PHP "null"

In PHP-2.0 and below we by mistake returned "obcect(FFI\CData:void)#2 (0) {}".
We decided not to fix this in PHP-2.0 and below to a

Make C functions returning "void" to return PHP "null"

In PHP-2.0 and below we by mistake returned "obcect(FFI\CData:void)#2 (0) {}".
We decided not to fix this in PHP-2.0 and below to aboid BC breaks.

show more ...


# 1a5fc6e1 13-Feb-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix assertion failure when var_dump'ing void FFI result (#10568)


# d2cdfdbe 04-Feb-2023 rj1

fixed some misspellings (#10503)


123456789