Re: _types.h: increase size of size_t

2020-04-24 Thread Stuart Henderson
On 2020-04-24, Otto Moerbeek  wrote:
> On Thu, Apr 23, 2020 at 10:45:38PM -0400, Ian Sutton wrote:
>
>> Following the revalations made by a misc@ poster, I am happy to present
>> the following patch which increases the width of size_t from "long" to
>> "long long", which is twice the width as before, on all platforms. This
>> has the effect of doubling the amount of available memory regardless of
>> the physical capacity installed memory hardware. Additionally, it
>> enables PAE on all 32 bit platforms without incurring performance costs.
>
> You must be out of your mind.

I assumed it was a mail delayed from 1 April or something :)




Re: _types.h: increase size of size_t

2020-04-24 Thread Otto Moerbeek
On Thu, Apr 23, 2020 at 10:45:38PM -0400, Ian Sutton wrote:

> Following the revalations made by a misc@ poster, I am happy to present
> the following patch which increases the width of size_t from "long" to
> "long long", which is twice the width as before, on all platforms. This
> has the effect of doubling the amount of available memory regardless of
> the physical capacity installed memory hardware. Additionally, it
> enables PAE on all 32 bit platforms without incurring performance costs.

You must be out of your mind.

-Otto

>  
> Index: arch/alpha/include/_types.h
> ===
> RCS file: /cvs/src/sys/arch/alpha/include/_types.h,v
> retrieving revision 1.24
> diff -u -p -r1.24 _types.h
> --- arch/alpha/include/_types.h   5 Mar 2018 01:15:24 -   1.24
> +++ arch/alpha/include/_types.h   24 Apr 2020 02:26:13 -
> @@ -120,7 +120,7 @@ typedef unsigned long __psize_t;
>  typedef double   __double_t;
>  typedef float__float_t;
>  typedef long __ptrdiff_t;
> -typedef  unsigned long   __size_t;
> +typedef  unsigned long long__size_t;
>  typedef  long__ssize_t;
>  #if defined(__GNUC__) && __GNUC__ >= 3
>  typedef  __builtin_va_list   __va_list;
> Index: arch/amd64/include/_types.h
> ===
> RCS file: /cvs/src/sys/arch/amd64/include/_types.h,v
> retrieving revision 1.17
> diff -u -p -r1.17 _types.h
> --- arch/amd64/include/_types.h   5 Mar 2018 01:15:25 -   1.17
> +++ arch/amd64/include/_types.h   24 Apr 2020 02:26:13 -
> @@ -120,7 +120,7 @@ typedef unsigned long __psize_t;
>  typedef  double  __double_t;
>  typedef  float   __float_t;
>  typedef long __ptrdiff_t;
> -typedef  unsigned long   __size_t;
> +typedef  unsigned long long__size_t;
>  typedef  long__ssize_t;
>  #if defined(__GNUC__) && __GNUC__ >= 3
>  typedef  __builtin_va_list   __va_list;
> Index: arch/arm/include/_types.h
> ===
> RCS file: /cvs/src/sys/arch/arm/include/_types.h,v
> retrieving revision 1.19
> diff -u -p -r1.19 _types.h
> --- arch/arm/include/_types.h 5 Mar 2018 01:15:25 -   1.19
> +++ arch/arm/include/_types.h 24 Apr 2020 02:26:13 -
> @@ -120,7 +120,7 @@ typedef unsigned long __psize_t;
>  typedef double   __double_t;
>  typedef float__float_t;
>  typedef long __ptrdiff_t;
> -typedef  unsigned long   __size_t;
> +typedef  unsigned long long__size_t;
>  typedef  long__ssize_t;
>  #if defined(__GNUC__) && __GNUC__ >= 3
>  typedef  __builtin_va_list   __va_list;
> Index: arch/arm64/include/_types.h
> ===
> RCS file: /cvs/src/sys/arch/arm64/include/_types.h,v
> retrieving revision 1.4
> diff -u -p -r1.4 _types.h
> --- arch/arm64/include/_types.h   5 Mar 2018 01:15:25 -   1.4
> +++ arch/arm64/include/_types.h   24 Apr 2020 02:26:13 -
> @@ -121,7 +121,7 @@ typedef unsigned long __psize_t;
>  typedef  double  __double_t;
>  typedef  float   __float_t;
>  typedef  long__ptrdiff_t;
> -typedef  unsigned long   __size_t;
> +typedef  unsigned long long__size_t;
>  typedef  long__ssize_t;
>  #if defined(__GNUC__) && __GNUC__ >= 3
>  typedef  __builtin_va_list   __va_list;
> Index: arch/hppa/include/_types.h
> ===
> RCS file: /cvs/src/sys/arch/hppa/include/_types.h,v
> retrieving revision 1.26
> diff -u -p -r1.26 _types.h
> --- arch/hppa/include/_types.h5 Mar 2018 01:15:25 -   1.26
> +++ arch/hppa/include/_types.h24 Apr 2020 02:26:13 -
> @@ -124,7 +124,7 @@ typedef unsigned long __psize_t;
>  typedef double   __double_t;
>  typedef float__float_t;
>  typedef long __ptrdiff_t;
> -typedef  unsigned long   __size_t;
> +typedef  unsigned long long__size_t;
>  typedef  long__ssize_t;
>  #if defined(__GNUC__) && __GNUC__ >= 3
>  typedef  __builtin_va_list   __va_list;
> Index: arch/i386/include/_types.h
> ===
> RCS file: /cvs/src/sys/arch/i386/include/_types.h,v
> retrieving revision 1.23
> diff -u -p -r1.23 _types.h
> --- arch/i386/include/_types.h5 Mar 2018 01:15:25 -   1.23
> +++ arch/i386/include/_types.h24 Apr 2020 

Re: _types.h: increase size of size_t

2020-04-24 Thread Anders Andersson
On Fri, Apr 24, 2020 at 4:47 AM Ian Sutton  wrote:
>
> Following the revalations made by a misc@ poster, I am happy to present
> the following patch which increases the width of size_t from "long" to
> "long long", which is twice the width as before, on all platforms. This
> has the effect of doubling the amount of available memory regardless of
> the physical capacity installed memory hardware. Additionally, it
> enables PAE on all 32 bit platforms without incurring performance costs.

This may go against a direct recommendation in the C standard for some
or all of these platforms.

"The types used for size_t and ptrdiff_t should not have an integer
conversion rank greater than that of signed long int unless the
implementation supports objects large enough to make this necessary."

Presumably the unnamed misc@ poster was unsafely mixing pointers and
integer types.



_types.h: increase size of size_t

2020-04-23 Thread Ian Sutton
Following the revalations made by a misc@ poster, I am happy to present
the following patch which increases the width of size_t from "long" to
"long long", which is twice the width as before, on all platforms. This
has the effect of doubling the amount of available memory regardless of
the physical capacity installed memory hardware. Additionally, it
enables PAE on all 32 bit platforms without incurring performance costs.
 
Index: arch/alpha/include/_types.h
===
RCS file: /cvs/src/sys/arch/alpha/include/_types.h,v
retrieving revision 1.24
diff -u -p -r1.24 _types.h
--- arch/alpha/include/_types.h 5 Mar 2018 01:15:24 -   1.24
+++ arch/alpha/include/_types.h 24 Apr 2020 02:26:13 -
@@ -120,7 +120,7 @@ typedef unsigned long   __psize_t;
 typedef double __double_t;
 typedef float  __float_t;
 typedef long   __ptrdiff_t;
-typedefunsigned long   __size_t;
+typedefunsigned long long__size_t;
 typedeflong__ssize_t;
 #if defined(__GNUC__) && __GNUC__ >= 3
 typedef__builtin_va_list   __va_list;
Index: arch/amd64/include/_types.h
===
RCS file: /cvs/src/sys/arch/amd64/include/_types.h,v
retrieving revision 1.17
diff -u -p -r1.17 _types.h
--- arch/amd64/include/_types.h 5 Mar 2018 01:15:25 -   1.17
+++ arch/amd64/include/_types.h 24 Apr 2020 02:26:13 -
@@ -120,7 +120,7 @@ typedef unsigned long   __psize_t;
 typedefdouble  __double_t;
 typedeffloat   __float_t;
 typedef long   __ptrdiff_t;
-typedefunsigned long   __size_t;
+typedefunsigned long long__size_t;
 typedeflong__ssize_t;
 #if defined(__GNUC__) && __GNUC__ >= 3
 typedef__builtin_va_list   __va_list;
Index: arch/arm/include/_types.h
===
RCS file: /cvs/src/sys/arch/arm/include/_types.h,v
retrieving revision 1.19
diff -u -p -r1.19 _types.h
--- arch/arm/include/_types.h   5 Mar 2018 01:15:25 -   1.19
+++ arch/arm/include/_types.h   24 Apr 2020 02:26:13 -
@@ -120,7 +120,7 @@ typedef unsigned long   __psize_t;
 typedef double __double_t;
 typedef float  __float_t;
 typedef long   __ptrdiff_t;
-typedefunsigned long   __size_t;
+typedefunsigned long long__size_t;
 typedeflong__ssize_t;
 #if defined(__GNUC__) && __GNUC__ >= 3
 typedef__builtin_va_list   __va_list;
Index: arch/arm64/include/_types.h
===
RCS file: /cvs/src/sys/arch/arm64/include/_types.h,v
retrieving revision 1.4
diff -u -p -r1.4 _types.h
--- arch/arm64/include/_types.h 5 Mar 2018 01:15:25 -   1.4
+++ arch/arm64/include/_types.h 24 Apr 2020 02:26:13 -
@@ -121,7 +121,7 @@ typedef unsigned long   __psize_t;
 typedefdouble  __double_t;
 typedeffloat   __float_t;
 typedeflong__ptrdiff_t;
-typedefunsigned long   __size_t;
+typedefunsigned long long__size_t;
 typedeflong__ssize_t;
 #if defined(__GNUC__) && __GNUC__ >= 3
 typedef__builtin_va_list   __va_list;
Index: arch/hppa/include/_types.h
===
RCS file: /cvs/src/sys/arch/hppa/include/_types.h,v
retrieving revision 1.26
diff -u -p -r1.26 _types.h
--- arch/hppa/include/_types.h  5 Mar 2018 01:15:25 -   1.26
+++ arch/hppa/include/_types.h  24 Apr 2020 02:26:13 -
@@ -124,7 +124,7 @@ typedef unsigned long   __psize_t;
 typedef double __double_t;
 typedef float  __float_t;
 typedef long   __ptrdiff_t;
-typedefunsigned long   __size_t;
+typedefunsigned long long__size_t;
 typedeflong__ssize_t;
 #if defined(__GNUC__) && __GNUC__ >= 3
 typedef__builtin_va_list   __va_list;
Index: arch/i386/include/_types.h
===
RCS file: /cvs/src/sys/arch/i386/include/_types.h,v
retrieving revision 1.23
diff -u -p -r1.23 _types.h
--- arch/i386/include/_types.h  5 Mar 2018 01:15:25 -   1.23
+++ arch/i386/include/_types.h  24 Apr 2020 02:26:13 -
@@ -120,7 +120,7 @@ typedef unsigned long   __psize_t;
 typedef long double__double_t;
 typedef long double__float_t;
 typedef long   __ptrdiff_t;
-typedefunsigned long   __size_t;
+typedefunsigned long long__size_t;
 typedef