Internal change

PiperOrigin-RevId: 522253757
This commit is contained in:
MediaPipe Team 2023-04-05 23:12:46 -07:00 committed by Copybara-Service
parent 0067a1b5c2
commit 56b3cd4350

View File

@ -66,13 +66,13 @@ using ::absl::StatusCode;
// Gets the offset aligned to page size for mapping given files into memory by
// file descriptor correctly, as according to mmap(2), the offset used in mmap
// must be a multiple of sysconf(_SC_PAGE_SIZE).
int64 GetPageSizeAlignedOffset(int64 offset) {
int64_t GetPageSizeAlignedOffset(int64_t offset) {
#ifdef _WIN32
// mmap is not used on Windows
return 0;
#else
int64 aligned_offset = offset;
int64 page_size = sysconf(_SC_PAGE_SIZE);
int64_t aligned_offset = offset;
int64_t page_size = sysconf(_SC_PAGE_SIZE);
if (offset % page_size != 0) {
aligned_offset = offset / page_size * page_size;
}