Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 85266 invoked from network); 7 Nov 2007 12:24:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Nov 2007 12:24:13 -0000 Received: (qmail 56407 invoked by uid 500); 7 Nov 2007 12:24:01 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 56312 invoked by uid 500); 7 Nov 2007 12:24:01 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 56291 invoked by uid 99); 7 Nov 2007 12:24:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2007 04:24:01 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2007 12:24:44 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C7E0A714238 for ; Wed, 7 Nov 2007 04:23:50 -0800 (PST) Message-ID: <16776261.1194438230816.JavaMail.jira@brutus> Date: Wed, 7 Nov 2007 04:23:50 -0800 (PST) From: "Evgueni Brevnov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-5065) [drlvm][jit] OpcodeDesc structure is padded incorrectly In-Reply-To: <21044002.1194036290689.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-5065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540727 ] Evgueni Brevnov commented on HARMONY-5065: ------------------------------------------ I'd suggest using union to make size of OpcodeDesc be equal to 128. Something like: union { char dummy[128]; struct OpcodeDesc { }; }; This approach is more reliable and you still let compiler to align fields. What do you think? Thanks Evgueni > [drlvm][jit] OpcodeDesc structure is padded incorrectly > ------------------------------------------------------- > > Key: HARMONY-5065 > URL: https://issues.apache.org/jira/browse/HARMONY-5065 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Reporter: Ilya Berezhniuk > Priority: Minor > Attachments: H-5065.patch > > > OpcodeDesc structure is padded to 128 bytes with char[] array which size is calculated using a sum of other fields size. > This approach does not consider default enum size and field alignment. > I've checked sizeof(OpcodeDesc) on IA-32 Windows/Linux, it's 132 bytes. So if the goal was performance gain, then this goal is not achieved. > Probably #pragma pack(1) should be used to eliminate field alignment, and sizeof() should be used for padding size calculation. > On the other hand, unaligned fields can also affect performance, so additional padding should be used for frequently accessed fields. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.