diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-02-06 19:34:14 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-02-06 19:34:14 +0000 |
commit | 551b5a0ab788f3cec12a5897aef6077e78fd88a8 (patch) | |
tree | 09ac722162f3e4f6e94f4a73e373dd1d4ccf3eea | |
parent | 5d398a378ab7be40fc3ea01e846f33b3dc83e265 (diff) | |
download | external_llvm-551b5a0ab788f3cec12a5897aef6077e78fd88a8.zip external_llvm-551b5a0ab788f3cec12a5897aef6077e78fd88a8.tar.gz external_llvm-551b5a0ab788f3cec12a5897aef6077e78fd88a8.tar.bz2 |
Deallocate() methods now take a 'const void*' instead of a 'void *', matching observed behavior with how 'delete[]' can be used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63956 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Support/Allocator.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h index 97c6d18..f0c713a 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; }; |