| Index: src/base/platform/platform-cygwin.cc
|
| diff --git a/src/base/platform/platform-cygwin.cc b/src/base/platform/platform-cygwin.cc
|
| index 8a767cf2964214a1b9f96cd29f2cc08960eed16e..e09fc683956ed481f5eaf3feeaf0744155a2cf4d 100644
|
| --- a/src/base/platform/platform-cygwin.cc
|
| +++ b/src/base/platform/platform-cygwin.cc
|
| @@ -59,54 +59,6 @@ void* OS::Allocate(const size_t requested,
|
| }
|
|
|
|
|
| -class PosixMemoryMappedFile : public OS::MemoryMappedFile {
|
| - public:
|
| - PosixMemoryMappedFile(FILE* file, void* memory, int size)
|
| - : file_(file), memory_(memory), size_(size) { }
|
| - virtual ~PosixMemoryMappedFile();
|
| - virtual void* memory() { return memory_; }
|
| - virtual int size() { return size_; }
|
| - private:
|
| - FILE* file_;
|
| - void* memory_;
|
| - int size_;
|
| -};
|
| -
|
| -
|
| -OS::MemoryMappedFile* OS::MemoryMappedFile::open(const char* name) {
|
| - FILE* file = fopen(name, "r+");
|
| - if (file == NULL) return NULL;
|
| -
|
| - fseek(file, 0, SEEK_END);
|
| - int size = ftell(file);
|
| -
|
| - void* memory =
|
| - mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileno(file), 0);
|
| - return new PosixMemoryMappedFile(file, memory, size);
|
| -}
|
| -
|
| -
|
| -OS::MemoryMappedFile* OS::MemoryMappedFile::create(const char* name, int size,
|
| - void* initial) {
|
| - FILE* file = fopen(name, "w+");
|
| - if (file == NULL) return NULL;
|
| - int result = fwrite(initial, size, 1, file);
|
| - if (result < 1) {
|
| - fclose(file);
|
| - return NULL;
|
| - }
|
| - void* memory =
|
| - mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fileno(file), 0);
|
| - return new PosixMemoryMappedFile(file, memory, size);
|
| -}
|
| -
|
| -
|
| -PosixMemoryMappedFile::~PosixMemoryMappedFile() {
|
| - if (memory_) munmap(memory_, size_);
|
| - fclose(file_);
|
| -}
|
| -
|
| -
|
| std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
|
| std::vector<SharedLibraryAddresses> result;
|
| // This function assumes that the layout of the file is as follows:
|
|
|