From patchwork Sat Oct 27 01:50:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 10658015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 472B75A4 for ; Sat, 27 Oct 2018 01:50:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B6342C87F for ; Sat, 27 Oct 2018 01:50:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BA062C882; Sat, 27 Oct 2018 01:50:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B49D42C87F for ; Sat, 27 Oct 2018 01:50:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726679AbeJ0K3Y (ORCPT ); Sat, 27 Oct 2018 06:29:24 -0400 Received: from avasout03.plus.net ([84.93.230.244]:55876 "EHLO avasout03.plus.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726048AbeJ0K3Y (ORCPT ); Sat, 27 Oct 2018 06:29:24 -0400 Received: from [10.0.2.15] ([80.189.70.193]) by smtp with ESMTPA id GDjngYeN0fmQQGDjogjEKc; Sat, 27 Oct 2018 02:50:04 +0100 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.3 cv=Acuf4UfG c=1 sm=1 tr=0 a=wSR+GDtF+fsrIzE5OYgxVg==:117 a=wSR+GDtF+fsrIzE5OYgxVg==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=wp1E5GN8qXYykpndVyEA:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 To: Junio C Hamano Cc: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= , Derrick Stolee , GIT Mailing-list From: Ramsay Jones Subject: [PATCH 1/3] fetch-object.h: add missing declaration (hdr-check) Message-ID: <04b4fde9-fbad-9282-726e-0160995b0b28@ramsayjones.plus.com> Date: Sat, 27 Oct 2018 02:50:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 Content-Language: en-GB X-CMAE-Envelope: MS4wfOGOcRDJizD5viv89AC7QbdVS4Bgh4FuGNXwpOVk1qDDLcGaP+5rjjBoBchZPNuI/1HrBEd1WObCWmzq/Ce7Or3lY5E13wbUsYvTUvkLhAxzUhWW7nd+ QyIXtplgs10TDV+CCMx1GwE+E4H9SI9vF56m5JivttUULGeak0RMvXzoUpHHK7gp9edS8MUCkmMduw== Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Ramsay Jones --- fetch-object.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fetch-object.h b/fetch-object.h index d2f996d4e8..d6444caa5a 100644 --- a/fetch-object.h +++ b/fetch-object.h @@ -1,6 +1,8 @@ #ifndef FETCH_OBJECT_H #define FETCH_OBJECT_H +struct object_id; + void fetch_objects(const char *remote_name, const struct object_id *oids, int oid_nr); From patchwork Sat Oct 27 01:52:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 10658017 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9301215A7 for ; Sat, 27 Oct 2018 01:52:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 799E32C889 for ; Sat, 27 Oct 2018 01:52:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C7A22C892; Sat, 27 Oct 2018 01:52:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 009542C889 for ; Sat, 27 Oct 2018 01:52:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726415AbeJ0Kb1 (ORCPT ); Sat, 27 Oct 2018 06:31:27 -0400 Received: from avasout03.plus.net ([84.93.230.244]:56544 "EHLO avasout03.plus.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726048AbeJ0Kb0 (ORCPT ); Sat, 27 Oct 2018 06:31:26 -0400 Received: from [10.0.2.15] ([80.189.70.193]) by smtp with ESMTPA id GDlmgYeiefmQQGDlngjERz; Sat, 27 Oct 2018 02:52:07 +0100 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.3 cv=Acuf4UfG c=1 sm=1 tr=0 a=wSR+GDtF+fsrIzE5OYgxVg==:117 a=wSR+GDtF+fsrIzE5OYgxVg==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=8X0J4UNF0WQiq7mHffEA:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 To: Junio C Hamano Cc: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= , Derrick Stolee , GIT Mailing-list From: Ramsay Jones Subject: [PATCH 2/3] ewok_rlw.h: add missing 'inline' to function definition Message-ID: <1a465da6-d139-5880-72ff-c612b42c3b8f@ramsayjones.plus.com> Date: Sat, 27 Oct 2018 02:52:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 Content-Language: en-GB X-CMAE-Envelope: MS4wfJjMpVt929It/juvNyOcBnRQeUfN46mCk4OZE+A7VufKlLn0EtB1tBT/Kh6iFPWsz3S3MngiFgj7CmM9NnFifbfQuVrxIzpwz+L7JvMMuM1AKwWAQr+z +RvSuv7LiE5Hzyz2wXpiInd1tVzBgSrs2uVcT5LgxnJDQJ67f1+f9yoSD0Ntv1bbV+YLAVqrIzWgXg== Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The 'ewok_rlw.h' header file contains the rlw_get_run_bit() function definition, which is marked as 'static' but not 'inline'. At least when compiled by gcc, with the default -O2 optimization level, the function is actually inlined and leaves no static version in the ewah_bitmap.o and ewah_rlw.o object files. Despite this, add the missing 'inline' keyword to better describe the intended behaviour. Signed-off-by: Ramsay Jones --- ewah/ewok_rlw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ewah/ewok_rlw.h b/ewah/ewok_rlw.h index d487966935..bafa24f4c3 100644 --- a/ewah/ewok_rlw.h +++ b/ewah/ewok_rlw.h @@ -31,7 +31,7 @@ #define RLW_RUNNING_LEN_PLUS_BIT (((eword_t)1 << (RLW_RUNNING_BITS + 1)) - 1) -static int rlw_get_run_bit(const eword_t *word) +static inline int rlw_get_run_bit(const eword_t *word) { return *word & (eword_t)1; } From patchwork Sat Oct 27 01:53:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 10658019 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0FBB85A4 for ; Sat, 27 Oct 2018 01:54:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E62222C894 for ; Sat, 27 Oct 2018 01:54:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C23C22C89B; Sat, 27 Oct 2018 01:54:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E9582C894 for ; Sat, 27 Oct 2018 01:54:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726529AbeJ0KdT (ORCPT ); Sat, 27 Oct 2018 06:33:19 -0400 Received: from avasout03.plus.net ([84.93.230.244]:56903 "EHLO avasout03.plus.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726048AbeJ0KdT (ORCPT ); Sat, 27 Oct 2018 06:33:19 -0400 Received: from [10.0.2.15] ([80.189.70.193]) by smtp with ESMTPA id GDnagYeyOfmQQGDnbgjEYT; Sat, 27 Oct 2018 02:53:59 +0100 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.3 cv=Acuf4UfG c=1 sm=1 tr=0 a=wSR+GDtF+fsrIzE5OYgxVg==:117 a=wSR+GDtF+fsrIzE5OYgxVg==:17 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=m0tRhUayDAoa-ZVbAt0A:9 a=QEXdDO2ut3YA:10 a=yJM6EZoI5SlJf8ks9Ge_:22 X-AUTH: ramsayjones@:2500 To: Junio C Hamano Cc: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= , Derrick Stolee , GIT Mailing-list From: Ramsay Jones Subject: [PATCH 3/3] commit-reach.h: add missing declarations (hdr-check) Message-ID: <88102e3a-8a02-fca4-4daf-ab428008afc7@ramsayjones.plus.com> Date: Sat, 27 Oct 2018 02:53:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 Content-Language: en-GB X-CMAE-Envelope: MS4wfHV+znjCiE9B679de+JVeZGw+nIUluo8NDuKSXsoD5bot1MboVDt4i9D0f/TF1KFHxnWh5SCgoK+z2gowX49AaUisN3hdcBJuaM0bxb1Vf7+ELX4uyXS 4WoteR+5Op3HoyKzd//krGZ6X+C3mKIvqHzLv9w59EcsM9H7w2YURxYW Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add the necessary #includes and forward declarations to allow the header file to pass the 'hdr-check' target. Note that, since this header includes the commit-slab implementation header file (indirectly via commit-slab.h), some of the commit-slab inline functions (e.g contains_cache_at_peek()) will not compile without the complete type of 'struct commit'. Hence, we replace the forward declaration of 'struct commit' with the an #include of the 'commit.h' header file. It is possible, using the 'commit-slab-{decl,impl}.h' files, to avoid this inclusion of the 'commit.h' header. Commit a9f1f1f9f8 ("commit-slab.h: code split", 2018-05-19) separated the commit-slab interface from its implementation, to allow for the definition of a public commit-slab data structure. This enabled us to avoid including the commit-slab implementation in a header file, which could result in the replication of the commit-slab functions in each compilation unit in which it was included. Indeed, if you compile with optimizations disabled, then run this script: $ cat -n dup-static.sh 1 #!/bin/sh 2 3 nm $1 | grep ' t ' | cut -d' ' -f3 | sort | uniq -c | 4 sort -rn | grep -v ' 1' $ $ ./dup-static.sh git | grep contains 24 init_contains_cache_with_stride 24 init_contains_cache 24 contains_cache_peek 24 contains_cache_at_peek 24 contains_cache_at 24 clear_contains_cache $ you will find 24 copies of the commit-slab routines for the contains_cache. Of course, when you enable optimizations again, these duplicate static functions (mostly) disappear. Compiling with gcc at -O2, leaves two static functions, thus: $ nm commit-reach.o | grep contains_cache 0000000000000870 t contains_cache_at_peek.isra.1.constprop.6 $ nm ref-filter.o | grep contains_cache 00000000000002b0 t clear_contains_cache.isra.14 $ However, using a shared 'contains_cache' would result in all six of the above functions as external public functions in the git binary. At present, only three of these functions are actually called, so the trade-off seems to favour letting the compiler inline the commit-slab functions. Signed-off-by: Ramsay Jones --- commit-reach.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commit-reach.h b/commit-reach.h index 7d313e2975..f41d8f6ba3 100644 --- a/commit-reach.h +++ b/commit-reach.h @@ -1,12 +1,13 @@ #ifndef __COMMIT_REACH_H__ #define __COMMIT_REACH_H__ +#include "commit.h" #include "commit-slab.h" -struct commit; struct commit_list; -struct contains_cache; struct ref_filter; +struct object_id; +struct object_array; struct commit_list *get_merge_bases_many(struct commit *one, int n,