mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 12:47:08 +00:00
Consistent Integer Types
example of using, to avoid mixed usage of std::uint/std::int and uint/int... ```cpp using u64 = std::uint64_t; using u32 = std::uint32_t; using u16 = std::uint16_t; using u8 = std::uint8_t; using i64 = std::int64_t; using i32 = std::int32_t; using i16 = std::int16_t; using i8 = std::int8_t; using usize = std::size_t; using isize = std::ptrdiff_t; #if defined(__GNUC__) && defined(IS_64BIT) __extension__ using u128 = unsigned __int128; __extension__ using i128 = signed __int128; #endif ``` closes https://github.com/official-stockfish/Stockfish/pull/6874 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
e4a635486a
commit
dd3e1c4a50
@@ -34,12 +34,12 @@
|
||||
#include <unistd.h>
|
||||
|
||||
// Must be kept in sync with patch_x86_slice.sh
|
||||
extern const volatile uint64_t gUniversalNNUEOffset = 0xCAFE0FF5E70FF5E7ULL;
|
||||
extern const volatile uint64_t gUniversalNNUESize = 0xCAFE512ECAFE512EULL;
|
||||
extern const volatile Stockfish::u64 gUniversalNNUEOffset = 0xCAFE0FF5E70FF5E7ULL;
|
||||
extern const volatile Stockfish::u64 gUniversalNNUESize = 0xCAFE512ECAFE512EULL;
|
||||
|
||||
static const unsigned char* map_embedded_nnue() {
|
||||
char path[PATH_MAX];
|
||||
uint32_t len = sizeof(path);
|
||||
char path[PATH_MAX];
|
||||
Stockfish::u32 len = sizeof(path);
|
||||
if (_NSGetExecutablePath(path, &len) != 0)
|
||||
return nullptr;
|
||||
|
||||
@@ -51,9 +51,9 @@ static const unsigned char* map_embedded_nnue() {
|
||||
return nullptr;
|
||||
|
||||
// Align down to page size for mmap
|
||||
const uint64_t pageSize = uint64_t(sysconf(_SC_PAGESIZE));
|
||||
const uint64_t base = gUniversalNNUEOffset & ~(pageSize - 1);
|
||||
const uint64_t pad = gUniversalNNUEOffset - base;
|
||||
const Stockfish::u64 pageSize = Stockfish::u64(sysconf(_SC_PAGESIZE));
|
||||
const Stockfish::u64 base = gUniversalNNUEOffset & ~(pageSize - 1);
|
||||
const Stockfish::u64 pad = gUniversalNNUEOffset - base;
|
||||
|
||||
void* p =
|
||||
mmap(nullptr, size_t(gUniversalNNUESize + pad), PROT_READ, MAP_PRIVATE, fd, off_t(base));
|
||||
|
||||
Reference in New Issue
Block a user