Hi Zeev, Dmitry,

It is not my only concern, I'm grateful for the clarification whatever.

These are your actual words from the RFC:

> This works, but this functionality is not supported on all libffi
platforms, it is not efficient and leaks resources by the end of request.
It's recommended to minimize the usage of PHP callbacks.

To me, a foreign function interface where one side of the interface sounds
broken and inefficient, according to the author, is scary. I've never
worked with libffi, so don't know if that's normal ... but I think you can
understand my thoughts here.

Aside from whatever technical issues I may have misinterpreted or
misidentified, these are not my main objections to it being merged.

Cheers
Joe

On Thu, 31 Jan 2019 at 17:20, Zeev Suraski <z...@php.net> wrote:

>
>
> On Thu, Jan 31, 2019 at 6:09 PM Dmitry Stogov <dmi...@zend.com> wrote:
>
>> The fact that FFI may leak, is because it uses "unmanaged memory" (like
>> in real C). PHP reference counting and GC just can't handle all the
>> cases. It's impossible to automatically know what to do with C pointer,
>> when we get it from function or another structure. In this case
>> programmer have to care about freeing the pointer themselves (like in C).
>>
>> This obviously doesn't count as 'leaks'.  If it did, we could say that
> the Zend Extension API leaks, as it's completely up to the developer to
> handle memory management.
>
> Joe - if that's your concern, I think it's fair to say it's invalid and
> you have nothing to worry about.
>
> Zeev
>

Reply via email to