From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH 0/5] remove usage of register keyword in C Date: Tue, 31 Jul 2018 11:07:37 -0700 Message-ID: <20180731110737.38555f02@xeon-e3> References: <20180731163059.27085-1-stephen@networkplumber.org> <20180731164840.GD5211@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Adrien Mazarguil Return-path: Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 3818D37A2 for ; Tue, 31 Jul 2018 20:07:42 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id f1-v6so9463686pgq.12 for ; Tue, 31 Jul 2018 11:07:42 -0700 (PDT) In-Reply-To: <20180731164840.GD5211@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, 31 Jul 2018 18:48:40 +0200 Adrien Mazarguil wrote: > On Tue, Jul 31, 2018 at 09:30:54AM -0700, Stephen Hemminger wrote: > > Declaring variables as register in C is a leftover from an earlier > > era (like cassette tape decks in cars). > > I don't agree here. It's a hint for compilers and developers that the > address of such variables won't be needed (and cannot be taken) to enable > whatever optimizations are possible knowing this. > > Somewhat like inline functions, it's not a forced optimization, just a > useful hint that shouldn't hurt if used wisely. > > Besides, cassette decks are not dead yet :) If you look at the code, that is not how register is being used (ie. don't take address of this). It seems like an attempt at optimization.