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 -0000 1.24
+++ arch/alpha/include/_types.h 24 Apr 2020 02:26:13 -0000
@@ -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 -0000 1.17
+++ arch/amd64/include/_types.h 24 Apr 2020 02:26:13 -0000
@@ -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 -0000 1.19
+++ arch/arm/include/_types.h 24 Apr 2020 02:26:13 -0000
@@ -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 -0000 1.4
+++ arch/arm64/include/_types.h 24 Apr 2020 02:26:13 -0000
@@ -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.h 5 Mar 2018 01:15:25 -0000 1.26
+++ arch/hppa/include/_types.h 24 Apr 2020 02:26:13 -0000
@@ -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.h 5 Mar 2018 01:15:25 -0000 1.23
+++ arch/i386/include/_types.h 24 Apr 2020 02:26:13 -0000
@@ -120,7 +120,7 @@ typedef unsigned long __psize_t;
typedef long double __double_t;
typedef long double __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/m88k/include/_types.h
===================================================================
RCS file: /cvs/src/sys/arch/m88k/include/_types.h,v
retrieving revision 1.18
diff -u -p -r1.18 _types.h
--- arch/m88k/include/_types.h 5 Mar 2018 01:15:25 -0000 1.18
+++ arch/m88k/include/_types.h 24 Apr 2020 02:26:13 -0000
@@ -124,7 +124,7 @@ typedef unsigned long __psize_t;
typedef long double __double_t;
typedef long double __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/mips64/include/_types.h
===================================================================
RCS file: /cvs/src/sys/arch/mips64/include/_types.h,v
retrieving revision 1.23
diff -u -p -r1.23 _types.h
--- arch/mips64/include/_types.h 5 Mar 2018 01:15:25 -0000 1.23
+++ arch/mips64/include/_types.h 24 Apr 2020 02:26:13 -0000
@@ -125,7 +125,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/powerpc/include/_types.h
===================================================================
RCS file: /cvs/src/sys/arch/powerpc/include/_types.h,v
retrieving revision 1.23
diff -u -p -r1.23 _types.h
--- arch/powerpc/include/_types.h 5 Mar 2018 01:15:25 -0000 1.23
+++ arch/powerpc/include/_types.h 24 Apr 2020 02:26:13 -0000
@@ -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/sh/include/_types.h
===================================================================
RCS file: /cvs/src/sys/arch/sh/include/_types.h,v
retrieving revision 1.20
diff -u -p -r1.20 _types.h
--- arch/sh/include/_types.h 5 Mar 2018 01:15:25 -0000 1.20
+++ arch/sh/include/_types.h 24 Apr 2020 02:26:13 -0000
@@ -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/sparc64/include/_types.h
===================================================================
RCS file: /cvs/src/sys/arch/sparc64/include/_types.h,v
retrieving revision 1.23
diff -u -p -r1.23 _types.h
--- arch/sparc64/include/_types.h 5 Mar 2018 01:15:25 -0000 1.23
+++ arch/sparc64/include/_types.h 24 Apr 2020 02:26:14 -0000
@@ -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;