Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: runtime/bin/file_win.cc

Issue 2700673004: Windows: VirtualFree with MEM_RELEASE wants 0 instead of the region's size. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include "bin/file.h" 8 #include "bin/file.h"
9 9
10 #include <fcntl.h> // NOLINT 10 #include <fcntl.h> // NOLINT
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 if (!result) { 109 if (!result) {
110 Log::PrintErr("VirtualProtect failed %d\n", GetLastError()); 110 Log::PrintErr("VirtualProtect failed %d\n", GetLastError());
111 VirtualFree(addr, 0, MEM_RELEASE); 111 VirtualFree(addr, 0, MEM_RELEASE);
112 return NULL; 112 return NULL;
113 } 113 }
114 return new MappedMemory(addr, length); 114 return new MappedMemory(addr, length);
115 } 115 }
116 116
117 117
118 void MappedMemory::Unmap() { 118 void MappedMemory::Unmap() {
119 bool result = VirtualFree(address_, size_, MEM_RELEASE); 119 BOOL result = VirtualFree(address_, 0, MEM_RELEASE);
120 ASSERT(result); 120 ASSERT(result);
121 address_ = 0; 121 address_ = 0;
122 size_ = 0; 122 size_ = 0;
123 } 123 }
124 124
125 125
126 int64_t File::Read(void* buffer, int64_t num_bytes) { 126 int64_t File::Read(void* buffer, int64_t num_bytes) {
127 ASSERT(handle_->fd() >= 0); 127 ASSERT(handle_->fd() >= 0);
128 return read(handle_->fd(), buffer, num_bytes); 128 return read(handle_->fd(), buffer, num_bytes);
129 } 129 }
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 return kIdentical; 728 return kIdentical;
729 } else { 729 } else {
730 return kDifferent; 730 return kDifferent;
731 } 731 }
732 } 732 }
733 733
734 } // namespace bin 734 } // namespace bin
735 } // namespace dart 735 } // namespace dart
736 736
737 #endif // defined(TARGET_OS_WINDOWS) 737 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698