Remove trailing whitespace
Additionally, added a GitHub Action to ensure no more trailing whitespace will creep in again in the future. I'm excluding Markdown files from this check, since trailing whitespace is significant there, and also excluding `build-aux/install-sh` because there is significant trailing whitespace on the line that sets `defaultIFS`.
This commit is contained in:
parent
05385191d4
commit
f2e00d2fd3
10
.github/workflows/check_formatting.yaml
vendored
Normal file
10
.github/workflows/check_formatting.yaml
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
name: 'Check Formatting'
|
||||||
|
on: [pull_request]
|
||||||
|
jobs:
|
||||||
|
check-formatting:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Check for trailing whitespace
|
||||||
|
run: scripts/check_trailing_whitespace.sh
|
@ -4504,19 +4504,19 @@ sub FindLibrary {
|
|||||||
# For libc libraries, the copy in /usr/lib/debug contains debugging symbols
|
# For libc libraries, the copy in /usr/lib/debug contains debugging symbols
|
||||||
sub DebuggingLibrary {
|
sub DebuggingLibrary {
|
||||||
my $file = shift;
|
my $file = shift;
|
||||||
|
|
||||||
if ($file !~ m|^/|) {
|
if ($file !~ m|^/|) {
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Find debug symbol file if it's named after the library's name.
|
# Find debug symbol file if it's named after the library's name.
|
||||||
|
|
||||||
if (-f "/usr/lib/debug$file") {
|
if (-f "/usr/lib/debug$file") {
|
||||||
if($main::opt_debug) { print STDERR "found debug info for $file in /usr/lib/debug$file\n"; }
|
if($main::opt_debug) { print STDERR "found debug info for $file in /usr/lib/debug$file\n"; }
|
||||||
return "/usr/lib/debug$file";
|
return "/usr/lib/debug$file";
|
||||||
} elsif (-f "/usr/lib/debug$file.debug") {
|
} elsif (-f "/usr/lib/debug$file.debug") {
|
||||||
if($main::opt_debug) { print STDERR "found debug info for $file in /usr/lib/debug$file.debug\n"; }
|
if($main::opt_debug) { print STDERR "found debug info for $file in /usr/lib/debug$file.debug\n"; }
|
||||||
return "/usr/lib/debug$file.debug";
|
return "/usr/lib/debug$file.debug";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$main::opt_debug_syms_by_id) {
|
if(!$main::opt_debug_syms_by_id) {
|
||||||
@ -4525,7 +4525,7 @@ sub DebuggingLibrary {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Find debug file if it's named after the library's build ID.
|
# Find debug file if it's named after the library's build ID.
|
||||||
|
|
||||||
my $readelf = '';
|
my $readelf = '';
|
||||||
if (!$main::gave_up_on_elfutils) {
|
if (!$main::gave_up_on_elfutils) {
|
||||||
$readelf = qx/eu-readelf -n ${file}/;
|
$readelf = qx/eu-readelf -n ${file}/;
|
||||||
|
@ -115,7 +115,7 @@ fi
|
|||||||
if [ x"$dir_arg" != x ]; then
|
if [ x"$dir_arg" != x ]; then
|
||||||
dst=$src
|
dst=$src
|
||||||
src=""
|
src=""
|
||||||
|
|
||||||
if [ -d $dst ]; then
|
if [ -d $dst ]; then
|
||||||
instcmd=:
|
instcmd=:
|
||||||
else
|
else
|
||||||
@ -124,7 +124,7 @@ if [ x"$dir_arg" != x ]; then
|
|||||||
else
|
else
|
||||||
|
|
||||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||||
# might cause directories to be created, which would be especially bad
|
# might cause directories to be created, which would be especially bad
|
||||||
# if $src (and thus $dsttmp) contains '*'.
|
# if $src (and thus $dsttmp) contains '*'.
|
||||||
|
|
||||||
if [ -f $src -o -d $src ]
|
if [ -f $src -o -d $src ]
|
||||||
@ -134,7 +134,7 @@ else
|
|||||||
echo "install: $src does not exist"
|
echo "install: $src does not exist"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ x"$dst" = x ]
|
if [ x"$dst" = x ]
|
||||||
then
|
then
|
||||||
echo "install: no destination specified"
|
echo "install: no destination specified"
|
||||||
@ -201,17 +201,17 @@ else
|
|||||||
|
|
||||||
# If we're going to rename the final executable, determine the name now.
|
# If we're going to rename the final executable, determine the name now.
|
||||||
|
|
||||||
if [ x"$transformarg" = x ]
|
if [ x"$transformarg" = x ]
|
||||||
then
|
then
|
||||||
dstfile=`basename $dst`
|
dstfile=`basename $dst`
|
||||||
else
|
else
|
||||||
dstfile=`basename $dst $transformbasename |
|
dstfile=`basename $dst $transformbasename |
|
||||||
sed $transformarg`$transformbasename
|
sed $transformarg`$transformbasename
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# don't allow the sed command to completely eliminate the filename
|
# don't allow the sed command to completely eliminate the filename
|
||||||
|
|
||||||
if [ x"$dstfile" = x ]
|
if [ x"$dstfile" = x ]
|
||||||
then
|
then
|
||||||
dstfile=`basename $dst`
|
dstfile=`basename $dst`
|
||||||
else
|
else
|
||||||
@ -242,7 +242,7 @@ else
|
|||||||
# Now rename the file to the real destination.
|
# Now rename the file to the real destination.
|
||||||
|
|
||||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||||
|
|
||||||
fi &&
|
fi &&
|
||||||
|
|
||||||
|
@ -2501,7 +2501,7 @@ AC_SUBST([enable_initial_exec_tls])
|
|||||||
if test "x${je_cv_tls_model}" = "xyes" -a \
|
if test "x${je_cv_tls_model}" = "xyes" -a \
|
||||||
"x${enable_initial_exec_tls}" = "x1" ; then
|
"x${enable_initial_exec_tls}" = "x1" ; then
|
||||||
AC_DEFINE([JEMALLOC_TLS_MODEL],
|
AC_DEFINE([JEMALLOC_TLS_MODEL],
|
||||||
[__attribute__((tls_model("initial-exec")))],
|
[__attribute__((tls_model("initial-exec")))],
|
||||||
[ ])
|
[ ])
|
||||||
else
|
else
|
||||||
AC_DEFINE([JEMALLOC_TLS_MODEL], [ ], [ ])
|
AC_DEFINE([JEMALLOC_TLS_MODEL], [ ], [ ])
|
||||||
|
@ -446,9 +446,9 @@
|
|||||||
/* If defined, use volatile asm during benchmarks. */
|
/* If defined, use volatile asm during benchmarks. */
|
||||||
#undef JEMALLOC_HAVE_ASM_VOLATILE
|
#undef JEMALLOC_HAVE_ASM_VOLATILE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If defined, support the use of rdtscp to get the time stamp counter
|
* If defined, support the use of rdtscp to get the time stamp counter
|
||||||
* and the processor ID.
|
* and the processor ID.
|
||||||
*/
|
*/
|
||||||
#undef JEMALLOC_HAVE_RDTSCP
|
#undef JEMALLOC_HAVE_RDTSCP
|
||||||
|
|
||||||
|
@ -1,32 +1,32 @@
|
|||||||
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
||||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||||
//
|
//
|
||||||
// Copyright (c) 2006-2008 Alexander Chemeris
|
// Copyright (c) 2006-2008 Alexander Chemeris
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
// modification, are permitted provided that the following conditions are met:
|
// modification, are permitted provided that the following conditions are met:
|
||||||
//
|
//
|
||||||
// 1. Redistributions of source code must retain the above copyright notice,
|
// 1. Redistributions of source code must retain the above copyright notice,
|
||||||
// this list of conditions and the following disclaimer.
|
// this list of conditions and the following disclaimer.
|
||||||
//
|
//
|
||||||
// 2. Redistributions in binary form must reproduce the above copyright
|
// 2. Redistributions in binary form must reproduce the above copyright
|
||||||
// notice, this list of conditions and the following disclaimer in the
|
// notice, this list of conditions and the following disclaimer in the
|
||||||
// documentation and/or other materials provided with the distribution.
|
// documentation and/or other materials provided with the distribution.
|
||||||
//
|
//
|
||||||
// 3. The name of the author may be used to endorse or promote products
|
// 3. The name of the author may be used to endorse or promote products
|
||||||
// derived from this software without specific prior written permission.
|
// derived from this software without specific prior written permission.
|
||||||
//
|
//
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef _MSC_VER // [
|
#ifndef _MSC_VER // [
|
||||||
|
7
scripts/check_trailing_whitespace.sh
Executable file
7
scripts/check_trailing_whitespace.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if git grep -E '\s+$' -- ':!*.md' ':!build-aux/install-sh'
|
||||||
|
then
|
||||||
|
echo 'Error: found trailing whitespace' 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
@ -45,7 +45,7 @@
|
|||||||
/*-----------------
|
/*-----------------
|
||||||
BASIC DEFINITIONS
|
BASIC DEFINITIONS
|
||||||
-----------------*/
|
-----------------*/
|
||||||
/** Mersenne Exponent. The period of the sequence
|
/** Mersenne Exponent. The period of the sequence
|
||||||
* is a multiple of 2^MEXP-1.
|
* is a multiple of 2^MEXP-1.
|
||||||
* #define MEXP 19937 */
|
* #define MEXP 19937 */
|
||||||
/** SFMT generator has an internal state array of 128-bit integers,
|
/** SFMT generator has an internal state array of 128-bit integers,
|
||||||
@ -63,25 +63,25 @@
|
|||||||
following definitions are in paramsXXXX.h file.
|
following definitions are in paramsXXXX.h file.
|
||||||
----------------------*/
|
----------------------*/
|
||||||
/** the pick up position of the array.
|
/** the pick up position of the array.
|
||||||
#define POS1 122
|
#define POS1 122
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** the parameter of shift left as four 32-bit registers.
|
/** the parameter of shift left as four 32-bit registers.
|
||||||
#define SL1 18
|
#define SL1 18
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** the parameter of shift left as one 128-bit register.
|
/** the parameter of shift left as one 128-bit register.
|
||||||
* The 128-bit integer is shifted by (SL2 * 8) bits.
|
* The 128-bit integer is shifted by (SL2 * 8) bits.
|
||||||
#define SL2 1
|
#define SL2 1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** the parameter of shift right as four 32-bit registers.
|
/** the parameter of shift right as four 32-bit registers.
|
||||||
#define SR1 11
|
#define SR1 11
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** the parameter of shift right as one 128-bit register.
|
/** the parameter of shift right as one 128-bit register.
|
||||||
* The 128-bit integer is shifted by (SL2 * 8) bits.
|
* The 128-bit integer is shifted by (SL2 * 8) bits.
|
||||||
#define SR2 1
|
#define SR2 1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** A bitmask, used in the recursion. These parameters are introduced
|
/** A bitmask, used in the recursion. These parameters are introduced
|
||||||
@ -89,7 +89,7 @@
|
|||||||
#define MSK1 0xdfffffefU
|
#define MSK1 0xdfffffefU
|
||||||
#define MSK2 0xddfecb7fU
|
#define MSK2 0xddfecb7fU
|
||||||
#define MSK3 0xbffaffffU
|
#define MSK3 0xbffaffffU
|
||||||
#define MSK4 0xbffffff6U
|
#define MSK4 0xbffffff6U
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** These definitions are part of a 128-bit period certification vector.
|
/** These definitions are part of a 128-bit period certification vector.
|
||||||
|
@ -33,8 +33,8 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @file SFMT.h
|
* @file SFMT.h
|
||||||
*
|
*
|
||||||
* @brief SIMD oriented Fast Mersenne Twister(SFMT) pseudorandom
|
* @brief SIMD oriented Fast Mersenne Twister(SFMT) pseudorandom
|
||||||
* number generator
|
* number generator
|
||||||
@ -53,7 +53,7 @@
|
|||||||
* and you have to define PRIu64 and PRIx64 in this file as follows:
|
* and you have to define PRIu64 and PRIx64 in this file as follows:
|
||||||
* @verbatim
|
* @verbatim
|
||||||
typedef unsigned int uint32_t
|
typedef unsigned int uint32_t
|
||||||
typedef unsigned long long uint64_t
|
typedef unsigned long long uint64_t
|
||||||
#define PRIu64 "llu"
|
#define PRIu64 "llu"
|
||||||
#define PRIx64 "llx"
|
#define PRIx64 "llx"
|
||||||
@endverbatim
|
@endverbatim
|
||||||
@ -84,8 +84,8 @@ int get_min_array_size64(void);
|
|||||||
/* These real versions are due to Isaku Wada */
|
/* These real versions are due to Isaku Wada */
|
||||||
/** generates a random number on [0,1]-real-interval */
|
/** generates a random number on [0,1]-real-interval */
|
||||||
static inline double to_real1(uint32_t v) {
|
static inline double to_real1(uint32_t v) {
|
||||||
return v * (1.0/4294967295.0);
|
return v * (1.0/4294967295.0);
|
||||||
/* divided by 2^32-1 */
|
/* divided by 2^32-1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
/** generates a random number on [0,1]-real-interval */
|
/** generates a random number on [0,1]-real-interval */
|
||||||
@ -95,7 +95,7 @@ static inline double genrand_real1(sfmt_t *ctx) {
|
|||||||
|
|
||||||
/** generates a random number on [0,1)-real-interval */
|
/** generates a random number on [0,1)-real-interval */
|
||||||
static inline double to_real2(uint32_t v) {
|
static inline double to_real2(uint32_t v) {
|
||||||
return v * (1.0/4294967296.0);
|
return v * (1.0/4294967296.0);
|
||||||
/* divided by 2^32 */
|
/* divided by 2^32 */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ static inline double genrand_real2(sfmt_t *ctx) {
|
|||||||
|
|
||||||
/** generates a random number on (0,1)-real-interval */
|
/** generates a random number on (0,1)-real-interval */
|
||||||
static inline double to_real3(uint32_t v) {
|
static inline double to_real3(uint32_t v) {
|
||||||
return (((double)v) + 0.5)*(1.0/4294967296.0);
|
return (((double)v) + 0.5)*(1.0/4294967296.0);
|
||||||
/* divided by 2^32 */
|
/* divided by 2^32 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ do_arena_create(ssize_t dirty_decay_ms, ssize_t muzzy_decay_ms) {
|
|||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
do_arena_destroy(unsigned arena_ind) {
|
do_arena_destroy(unsigned arena_ind) {
|
||||||
/*
|
/*
|
||||||
* For convenience, flush tcache in case there are cached items.
|
* For convenience, flush tcache in case there are cached items.
|
||||||
* However not assert success since the tcache may be disabled.
|
* However not assert success since the tcache may be disabled.
|
||||||
*/
|
*/
|
||||||
|
@ -28,12 +28,12 @@ timer_ratio(timedelta_t *a, timedelta_t *b, char *buf, size_t buflen) {
|
|||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
size_t j, n;
|
size_t j, n;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The time difference could be 0 if the two clock readings are
|
* The time difference could be 0 if the two clock readings are
|
||||||
* identical, either due to the operations being measured in the middle
|
* identical, either due to the operations being measured in the middle
|
||||||
* took very little time (or even got optimized away), or the clock
|
* took very little time (or even got optimized away), or the clock
|
||||||
* readings are bad / very coarse grained clock.
|
* readings are bad / very coarse grained clock.
|
||||||
* Thus, bump t1 if it is 0 to avoid dividing 0.
|
* Thus, bump t1 if it is 0 to avoid dividing 0.
|
||||||
*/
|
*/
|
||||||
if (t1 == 0) {
|
if (t1 == 0) {
|
||||||
t1 = 1;
|
t1 = 1;
|
||||||
|
@ -52,15 +52,15 @@ malloc_sdallocx(void) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
TEST_BEGIN(test_free_vs_delete) {
|
TEST_BEGIN(test_free_vs_delete) {
|
||||||
compare_funcs(10*1000*1000, 100*1000*1000,
|
compare_funcs(10*1000*1000, 100*1000*1000,
|
||||||
"malloc_free", (void *)malloc_free,
|
"malloc_free", (void *)malloc_free,
|
||||||
"new_delete", (void *)new_delete);
|
"new_delete", (void *)new_delete);
|
||||||
}
|
}
|
||||||
TEST_END
|
TEST_END
|
||||||
|
|
||||||
TEST_BEGIN(test_free_array_vs_delete_array) {
|
TEST_BEGIN(test_free_array_vs_delete_array) {
|
||||||
compare_funcs(10*1000*1000, 100*1000*1000,
|
compare_funcs(10*1000*1000, 100*1000*1000,
|
||||||
"malloc_free_array", (void *)malloc_free_array,
|
"malloc_free_array", (void *)malloc_free_array,
|
||||||
"delete_array", (void *)new_delete_array);
|
"delete_array", (void *)new_delete_array);
|
||||||
}
|
}
|
||||||
TEST_END
|
TEST_END
|
||||||
@ -68,8 +68,8 @@ TEST_END
|
|||||||
|
|
||||||
TEST_BEGIN(test_sized_delete_vs_sdallocx) {
|
TEST_BEGIN(test_sized_delete_vs_sdallocx) {
|
||||||
#if __cpp_sized_deallocation >= 201309
|
#if __cpp_sized_deallocation >= 201309
|
||||||
compare_funcs(10*1000*1000, 100*1000*1000,
|
compare_funcs(10*1000*1000, 100*1000*1000,
|
||||||
"new_size_delete", (void *)new_sized_delete,
|
"new_size_delete", (void *)new_sized_delete,
|
||||||
"malloc_sdallocx", (void *)malloc_sdallocx);
|
"malloc_sdallocx", (void *)malloc_sdallocx);
|
||||||
#else
|
#else
|
||||||
malloc_printf("Skipping test_sized_delete_vs_sdallocx since \
|
malloc_printf("Skipping test_sized_delete_vs_sdallocx since \
|
||||||
|
Loading…
Reference in New Issue
Block a user