Reduce `PrimaryRegionSizeLog` to 28U to be compatible with a 38bit user
address space on the fuchsia-riscv platform. `PrimaryGroupSizeLog` is
reduced to 19 to preserve 512 BatchGroups per region.
This change can be tested on Fuchsia with:
```
fx set --auto-dir bringup.riscv64 --with //bundles:boot_tests \
fx build bundles:boot_tests \
fx run-boot-test --args={-s,1} boot-libc-unittests \
--cmdline='--gtest_filter=-*DeathTest*:PthreadGetSet*:ScudoSecondaryTest*'
```
The gtest filter ignores pthread and death tests due to non-scudo
related issues on fuchsia-riscv (ScudoSecondaryTest includes a death
check).
Related Ticket: https://fxbug.dev/125263
Differential Revision: https://reviews.llvm.org/D148475
static const bool MaySupportMemoryTagging = false;
typedef SizeClassAllocator64<FuchsiaConfig> Primary;
+// Support 39-bit VMA for riscv-64
+#if SCUDO_RISCV64
+ static const uptr PrimaryRegionSizeLog = 28U;
+ static const uptr PrimaryGroupSizeLog = 19U;
+#else
static const uptr PrimaryRegionSizeLog = 30U;
static const uptr PrimaryGroupSizeLog = 21U;
+#endif
typedef u32 PrimaryCompactPtrT;
static const bool PrimaryEnableRandomOffset = true;
static const uptr PrimaryMapSizeIncrement = 1UL << 18;
#define SCUDO_TRUSTY 0
#endif
+#if defined(__riscv) && (__riscv_xlen == 64)
+#define SCUDO_RISCV64 1
+#else
+#define SCUDO_RISCV64 0
+#endif
+
#if defined(__LP64__)
#define SCUDO_WORDSIZE 64U
#else