Skip to content

Commit 788f2b6

Browse files
committed
GPU compilation.
1 parent d3987e8 commit 788f2b6

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/common/io.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,6 @@ auto SystemErrorMsg() {
203203
}
204204
} // anonymous namespace
205205

206-
PrivateMmapStream::PrivateMmapStream(std::string path, bool read_only, std::size_t offset,
207-
std::size_t length)
208-
: MemoryFixSizeBuffer{} {
209-
this->p_buffer_ = Open(std::move(path), read_only, offset, length);
210-
this->buffer_size_ = length;
211-
}
212-
213206
char* PrivateMmapStream::Open(std::string path, bool read_only, std::size_t offset,
214207
std::size_t length) {
215208
#if defined(_MSC_VER)
@@ -257,6 +250,13 @@ char* PrivateMmapStream::Open(std::string path, bool read_only, std::size_t offs
257250
return ptr;
258251
}
259252

253+
PrivateMmapStream::PrivateMmapStream(std::string path, bool read_only, std::size_t offset,
254+
std::size_t length)
255+
: MemoryFixSizeBuffer{}, handle_{nullptr} {
256+
this->p_buffer_ = Open(std::move(path), read_only, offset, length);
257+
this->buffer_size_ = length;
258+
}
259+
260260
PrivateMmapStream::~PrivateMmapStream() {
261261
CHECK(handle_);
262262
#if defined(_MSC_VER)

src/common/io.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ std::size_t GetPageSize();
136136
*/
137137
class PrivateMmapStream : public MemoryFixSizeBuffer {
138138
struct MMAPFile;
139-
140-
std::unique_ptr<MMAPFile> handle_{nullptr};
139+
std::unique_ptr<MMAPFile> handle_;
141140

142141
char* Open(std::string path, bool read_only, std::size_t offset, std::size_t length);
143142

0 commit comments

Comments
 (0)