Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103932 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 35629 invoked from network); 31 Jan 2019 19:43:57 -0000 Received: from unknown (HELO mail-wr1-f46.google.com) (209.85.221.46) by pb1.pair.com with SMTP; 31 Jan 2019 19:43:57 -0000 Received: by mail-wr1-f46.google.com with SMTP id p7so4034787wru.0 for ; Thu, 31 Jan 2019 08:23:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tXRdnQY0ml3lmQWxy1sooCnFYNrG0+pjTCis0K8x3SQ=; b=NYvjCl1ZoA1ECHSdktroOoYICoEgFBqIPlXJzE7kzeyF9a8cchLZGo3r8a77dizBOT 7QfoXjdbd8MqUOM3LXc7sVZE6RjB9EyxicRcT1uGLY5kdRBfiVCOmq77rrf5lE2nkT5L Lflvn7v8vYIErW+25lgF8lTQPKd/vxKaHXcA3j9ScKxNcHII6l34PAkulTPHW3cquhI7 +c8UXwQleRRgENnNMS5qbiIx0TaH8gEcvYDWNsbKJxfdXIcAb8T58Wk8oQ3mkVD+aziW cJkBJPyExEEvWWcz11zIaLycKgM3vj4ls8OR3mfkHbUJfOSNzNw5oYUtj7jrBuNydWxG 790Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tXRdnQY0ml3lmQWxy1sooCnFYNrG0+pjTCis0K8x3SQ=; b=eaDzmH1M2t5dfDeDvMr524IzmTiRV8ckBtwacR6UH+bSMIti+B29V3eUdqDndEeNe0 mkiWPv0lvIMpA6SCQt3VR2Y8y8Urg8kfbO7fvhGUB09y1csH2PuyANqVUoMB6+SodQvc 80d2se33ZLm290jVJ7+pZ9wftCTcTPtcMB9BgPYQRmG32dLGhf048Z/oyo6HDQKPU9CE mztllqOqkrabVqPFFzcWxhtXDALjhHapZ6mxwggItlgn8GcGEQ2gLQHQeJ2asI/JkwOb rqfYjAEWb3hnHZpx5Z1IlN6s/Vsw+POQniCd5oGWfP+tZzGwtHQp7AwtsMduDAYQPEK8 ZmAw== X-Gm-Message-State: AJcUukekX5l10XkE1OxOdXzNP5LP+nFlc2sGEeLoWaDZvUlcQJPOAkN3 g+ETCbBwhwsAmLje4KxTLdqxodx7XgY593heth3pH+bN18w= X-Google-Smtp-Source: ALg8bN437EVV6BV8xksH0PRpfZl9q1Vi1vHsjQvSkUSChmLV5wMg5WgjPauiuUrSfSxXIebET7w2MgyjDIEjszLBJnQ= X-Received: by 2002:a5d:5111:: with SMTP id s17mr34090412wrt.43.1548951831966; Thu, 31 Jan 2019 08:23:51 -0800 (PST) MIME-Version: 1.0 References: <13d4f2b0-6d4f-d6de-e61f-4fb782da82bf@zend.com> In-Reply-To: Date: Thu, 31 Jan 2019 17:23:40 +0100 Message-ID: To: Zeev Suraski Cc: Dmitry Stogov , Zeev Suraski , "internals@lists.php.net" Content-Type: multipart/alternative; boundary="000000000000b7f90b0580c373da" Subject: Re: [PHP-DEV] RFC Abolish Narrow Margins From: krakjoe@gmail.com (Joe Watkins) --000000000000b7f90b0580c373da Content-Type: text/plain; charset="UTF-8" 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 wrote: > > > On Thu, Jan 31, 2019 at 6:09 PM Dmitry Stogov 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 > --000000000000b7f90b0580c373da--