aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/singlejar/mapped_file_posix.inc
diff options
context:
space:
mode:
authorGravatar Loo Rong Jie <loorongjie@gmail.com>2018-08-08 22:52:58 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-08-08 22:54:22 -0700
commit27385b1acfbecb815862762337ba1cdde7237576 (patch)
tree6a5e535af555ce157f6e259521f7e480ae07fb9a /src/tools/singlejar/mapped_file_posix.inc
parentc535ac28697d49f436a70f3aa7f1d1e938db5d3c (diff)
[singlejar] Port mapped_file for Windows
`src/tools/singlejar/mapped_file_*.inc` are now included in `src/tools/singlejar/mapped_file.cc` instead of header file and no longer inline most member functions: these functions are too large for inlining. /cc @laszlocsomor Closes #5780. PiperOrigin-RevId: 207998444
Diffstat (limited to 'src/tools/singlejar/mapped_file_posix.inc')
-rw-r--r--src/tools/singlejar/mapped_file_posix.inc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/tools/singlejar/mapped_file_posix.inc b/src/tools/singlejar/mapped_file_posix.inc
index ad6c6a5310..637661b719 100644
--- a/src/tools/singlejar/mapped_file_posix.inc
+++ b/src/tools/singlejar/mapped_file_posix.inc
@@ -30,10 +30,10 @@
#error This code for 64 bit Unix.
#endif
-inline MappedFile::MappedFile()
+MappedFile::MappedFile()
: mapped_start_(nullptr), mapped_end_(nullptr), fd_(-1) {}
-inline bool MappedFile::Open(const std::string& path) {
+bool MappedFile::Open(const std::string& path) {
if (is_open()) {
diag_errx(1, "%s:%d: This instance is already open", __FILE__, __LINE__);
}
@@ -60,7 +60,7 @@ inline bool MappedFile::Open(const std::string& path) {
return true;
}
-inline void MappedFile::Close() {
+void MappedFile::Close() {
if (is_open()) {
munmap(mapped_start_, mapped_end_ - mapped_start_);
mapped_start_ = mapped_end_ = nullptr;
@@ -69,6 +69,4 @@ inline void MappedFile::Close() {
}
}
-inline bool MappedFile::is_open() const { return fd_ >= 0; }
-
#endif // BAZEL_SRC_TOOLS_SINGLEJAR_MAPPED_FILE_POSIX_H_