From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 1/3] KVM: VMX: Use proper types to access const arrays Date: Thu, 27 Jun 2013 15:47:32 +0200 Message-ID: <51CC4274.4000306@redhat.com> References: <1372271783-18732-1-git-send-email-minipli@googlemail.com> <1372271783-18732-2-git-send-email-minipli@googlemail.com> <51CC3F37.6000406@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , kvm@vger.kernel.org To: Mathias Krause Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46460 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751569Ab3F0Nrk (ORCPT ); Thu, 27 Jun 2013 09:47:40 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Il 27/06/2013 15:42, Mathias Krause ha scritto: > > The "const int" is not particularly useful, but doesn't hurt either. > > It's more of a hint for the compiler to take the values verbatim > instead of allocating stack space for them. But it'll probably already > do it even without that "hint". It won't change anything really. Maybe for "const int foo[]", but I'm not even sure about that and it depends a lot on the circumstances (loop unrolling, inlining, whether you ever store "foo" in a variable or pass it as a parameter, ...). The compiler may leave it on the stack anyway. Paolo