aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Support/Allocator.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h
index 97c6d187a7..f0c713af86 100644
--- a/include/llvm/Support/Allocator.h
+++ b/include/llvm/Support/Allocator.h
@@ -36,7 +36,7 @@ public:
return static_cast<T*>(malloc(sizeof(T)*Num));
}
- void Deallocate(void *Ptr) { free(Ptr); }
+ void Deallocate(const void *Ptr) { free(const_cast<void*>(Ptr)); }
void PrintStats() const {}
};
@@ -80,9 +80,8 @@ public:
unsigned EltSize = (sizeof(T)+Alignment-1)&~Alignment;
return static_cast<T*>(Allocate(Num * EltSize, Alignment));
}
-
-
- void Deallocate(void * /*Ptr*/) {}
+
+ void Deallocate(const void * /*Ptr*/) {}
void PrintStats() const;
};