diff options
Diffstat (limited to 'linker/linker_mapped_file_fragment.cpp')
-rw-r--r-- | linker/linker_mapped_file_fragment.cpp | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/linker/linker_mapped_file_fragment.cpp b/linker/linker_mapped_file_fragment.cpp index 6a500ef1e..27c1c69af 100644 --- a/linker/linker_mapped_file_fragment.cpp +++ b/linker/linker_mapped_file_fragment.cpp @@ -16,32 +16,13 @@ #include "linker_mapped_file_fragment.h" #include "linker_debug.h" +#include "linker_utils.h" #include <inttypes.h> #include <stdlib.h> #include <sys/mman.h> #include <unistd.h> -constexpr off64_t kPageMask = ~static_cast<off64_t>(PAGE_SIZE-1); - -static off64_t page_start(off64_t offset) { - return offset & kPageMask; -} - -static bool safe_add(off64_t* out, off64_t a, size_t b) { - CHECK(a >= 0); - if (static_cast<uint64_t>(INT64_MAX - a) < b) { - return false; - } - - *out = a + b; - return true; -} - -static size_t page_offset(off64_t offset) { - return static_cast<size_t>(offset & (PAGE_SIZE-1)); -} - MappedFileFragment::MappedFileFragment() : map_start_(nullptr), map_size_(0), data_(nullptr), size_ (0) { } |