[llvm-commits] [compiler-rt] r157750 - /compiler-rt/trunk/lib/asan/asan_win.cc
Kostya Serebryany
kcc at google.com
Thu May 31 09:06:06 PDT 2012
Author: kcc
Date: Thu May 31 11:06:05 2012
New Revision: 157750
URL: http://llvm.org/viewvc/llvm-project?rev=157750&view=rev
Log:
[asan] partial fix for windows build
Modified:
compiler-rt/trunk/lib/asan/asan_win.cc
Modified: compiler-rt/trunk/lib/asan/asan_win.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_win.cc?rev=157750&r1=157749&r2=157750&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_win.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_win.cc Thu May 31 11:06:05 2012
@@ -32,29 +32,29 @@
namespace __asan {
// ---------------------- Memory management ---------------- {{{1
-void *AsanMmapFixedNoReserve(uptr fixed_addr, size_t size) {
+void *AsanMmapFixedNoReserve(uptr fixed_addr, uptr size) {
return VirtualAlloc((LPVOID)fixed_addr, size,
MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
}
-void *AsanMmapSomewhereOrDie(size_t size, const char *mem_type) {
+void *AsanMmapSomewhereOrDie(uptr size, const char *mem_type) {
void *rv = VirtualAlloc(0, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
if (rv == 0)
OutOfMemoryMessageAndDie(mem_type, size);
return rv;
}
-void *AsanMprotect(uptr fixed_addr, size_t size) {
+void *AsanMprotect(uptr fixed_addr, uptr size) {
return VirtualAlloc((LPVOID)fixed_addr, size,
MEM_RESERVE | MEM_COMMIT, PAGE_NOACCESS);
}
-void AsanUnmapOrDie(void *addr, size_t size) {
+void AsanUnmapOrDie(void *addr, uptr size) {
CHECK(VirtualFree(addr, size, MEM_DECOMMIT));
}
// ---------------------- IO ---------------- {{{1
-size_t AsanWrite(int fd, const void *buf, size_t count) {
+uptr AsanWrite(int fd, const void *buf, uptr count) {
if (fd != 2)
UNIMPLEMENTED();
@@ -73,7 +73,7 @@
UNIMPLEMENTED();
}
-size_t AsanRead(int fd, void *buf, size_t count) {
+uptr AsanRead(int fd, void *buf, uptr count) {
UNIMPLEMENTED();
}
@@ -97,18 +97,18 @@
stack_bottom_ = (uptr)mbi.AllocationBase;
}
-void AsanStackTrace::GetStackTrace(size_t max_s, uptr pc, uptr bp) {
+void AsanStackTrace::GetStackTrace(uptr max_s, uptr pc, uptr bp) {
max_size = max_s;
void *tmp[kStackTraceMax];
// FIXME: CaptureStackBackTrace might be too slow for us.
// FIXME: Compare with StackWalk64.
// FIXME: Look at LLVMUnhandledExceptionFilter in Signals.inc
- size_t cs_ret = CaptureStackBackTrace(1, max_size, tmp, 0),
+ uptr cs_ret = CaptureStackBackTrace(1, max_size, tmp, 0),
offset = 0;
// Skip the RTL frames by searching for the PC in the stacktrace.
// FIXME: this doesn't work well for the malloc/free stacks yet.
- for (size_t i = 0; i < cs_ret; i++) {
+ for (uptr i = 0; i < cs_ret; i++) {
if (pc != (uptr)tmp[i])
continue;
offset = i;
@@ -116,7 +116,7 @@
}
size = cs_ret - offset;
- for (size_t i = 0; i < size; i++)
+ for (uptr i = 0; i < size; i++)
trace[i] = (uptr)tmp[i + offset];
}
@@ -308,7 +308,7 @@
return atexit(function);
}
-void SortArray(uptr *array, size_t size) {
+void SortArray(uptr *array, uptr size) {
std::sort(array, array + size);
}
More information about the llvm-commits
mailing list