Newsgroups: php.internals,php.internals.win Path: news.php.net Xref: news.php.net php.internals:89219 php.internals.win:1123 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14069 invoked from network); 15 Nov 2015 22:30:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Nov 2015 22:30:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=php_lists@realplain.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php_lists@realplain.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain realplain.com from 68.114.190.26 cause and error) X-PHP-List-Original-Sender: php_lists@realplain.com X-Host-Fingerprint: 68.114.190.26 mtaout001-public.msg.strl.va.charter.net Received: from [68.114.190.26] ([68.114.190.26:58580] helo=mtaout001-public.msg.strl.va.charter.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DD/01-29043-39709465 for ; Sun, 15 Nov 2015 17:30:43 -0500 Received: from impout004 ([68.114.189.19]) by mtaout001.msg.strl.va.charter.net (InterMail vM.9.00.021.00 201-2473-182) with ESMTP id <20151115223041.LVUZ1472.mtaout001.msg.strl.va.charter.net@impout004>; Sun, 15 Nov 2015 16:30:41 -0600 Received: from pc1 ([97.87.188.16]) by impout004 with charter.net id hyWg1r00F0Mfu3D01yWgxp; Sun, 15 Nov 2015 16:30:40 -0600 X-Authority-Analysis: v=2.1 cv=VONTnr/X c=1 sm=1 tr=0 a=Ay788ph35uAhBIV2K373vw==:117 a=Ay788ph35uAhBIV2K373vw==:17 a=hOpmn2quAAAA:8 a=BCPeO_TGAAAA:8 a=8nJEP1OIZ-IA:10 a=ZMRaQkUbtyhIhempKcsA:9 a=wPNLvfGTeEIA:10 Message-ID: <9B23C6783EE5480CB15EAC35B9E420EA@pc1> To: , Cc: "Dmitry Stogov" , "Anatol Belski" , "Pierre Joye" Date: Sun, 15 Nov 2015 16:30:40 -0600 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Subject: Windows (Visual Studio) compiler stuff From: php_lists@realplain.com ("Matt Wilmas") 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? 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...? Note: I didn't compile PHP, just quick standalone tests to check that "noinline" works, no useless functions, and no link error. Both VS 2008 & 2015 (same results). Thoughts? Thanks, Matt