Newsgroups: php.internals,php.internals.win Path: news.php.net Xref: news.php.net php.internals:89233 php.internals.win:1125 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73649 invoked from network); 16 Nov 2015 13:22:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2015 13:22:18 -0000 Authentication-Results: pb1.pair.com header.from=anatol.php@belski.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=anatol.php@belski.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain belski.net from 85.214.73.107 cause and error) X-PHP-List-Original-Sender: anatol.php@belski.net X-Host-Fingerprint: 85.214.73.107 klapt.com Received: from [85.214.73.107] ([85.214.73.107:33188] helo=h1123647.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 10/50-03003-288D9465 for ; Mon, 16 Nov 2015 08:22:11 -0500 Received: by h1123647.serverkompetenz.net (Postfix, from userid 1006) id D489123D612F; Mon, 16 Nov 2015 14:22:06 +0100 (CET) Received: from w530phpdev (p579F3834.dip0.t-ipconnect.de [87.159.56.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by h1123647.serverkompetenz.net (Postfix) with ESMTPSA id 573ED23D6124; Mon, 16 Nov 2015 14:22:04 +0100 (CET) To: "'Matt Wilmas'" , , Cc: "'Dmitry Stogov'" , "'Pierre Joye'" References: <9B23C6783EE5480CB15EAC35B9E420EA@pc1> In-Reply-To: <9B23C6783EE5480CB15EAC35B9E420EA@pc1> Date: Mon, 16 Nov 2015 14:22:00 +0100 Message-ID: <031201d12071$c8f66800$5ae33800$@belski.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQEiQ3+JiWbokf3YDWf6nHVaJvz+MJ/8EZNA Content-Language: en-us Subject: RE: [PHP-DEV] Windows (Visual Studio) compiler stuff From: anatol.php@belski.net ("Anatol Belski") Hello Matt, > -----Original Message----- > From: Matt Wilmas [mailto:php_lists@realplain.com] > Sent: Sunday, November 15, 2015 11:31 PM > To: internals@lists.php.net; internals-win@lists.php.net > Cc: Dmitry Stogov ; Anatol Belski ; > Pierre Joye > Subject: [PHP-DEV] Windows (Visual Studio) compiler stuff > > Hi Dmitry, Anatol, Pierre (etc.), and all, > > I'm back now, I think, after a much longer (unintentional) break than I expected. > Be coming very soon with what I was doing in the summer (param parsing stuff) > -- *now* it works with MSVC too, barring any fragility, as I accidentally > discovered last month... > > I've been "discovering" a lot with the wacky Visual Studio compiler! :-) This > message is about the 2 I found today. > > The first simple thing was probably just overlooked, but noticed it while looking > up __declspec. zend_never_inline has always been empty (I guess) for MSVC, > but there's actually a __declspec(noinline) that can be used (and works as > expected). A simple and obvious change to bring it in line with the other > compilers? > According to the docs __declspec(noinline) is specific to C++. Also with VS it's always much more tedious to inline something than the opposite. These are the main two reasons it's disregarded ATM. We can add it for compliance with C++, but it'll in best case have no effect in the PHP core. Should be tested before, though. > > The second "issue" is with the zend_always_inline functions, I noticed this > summer. Did anyone else know that MSVC leaves a *copy* of those functions in > the output files (DLLs)? What's the point of that? When they've been inlined, > and not referenced otherwise, there should be no reason to emit code for a > standalone function! > > I remembered after seeing that behavior that a bit of my own __forceinline'd > code did NOT have extra function code, but forgot to investigate until today. > What's different about my function definition? No "static" > specifier! So that's the key. :-) > > But... non-static would create duplicate symbols, I thought. But no, it works! > With just __forceinline, there's no errors. :^) > > Can something be done about this? It would cut the binary size down a bit. > A zend_static macro to be used with zend_always_inline...? > I'd ask you for some concrete case for this, as I'm not sure to understand exactly what you mean. The only case where an extra code would be generated is with "__declspec(export) inline", but that's not the case anywhere within PHP. Regards Anatol