From: Ted Kremenek Date: Fri, 6 Feb 2009 19:34:14 +0000 (+0000) Subject: Deallocate() methods now take a 'const void*' instead of a 'void *', matching observe... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=3f4c81de0ac7ff75e538dd68ef4ecfa204760bc9;p=oota-llvm.git 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 --- diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h index 97c6d187a72..f0c713af86d 100644 --- a/include/llvm/Support/Allocator.h +++ b/include/llvm/Support/Allocator.h @@ -36,7 +36,7 @@ public: return static_cast(malloc(sizeof(T)*Num)); } - void Deallocate(void *Ptr) { free(Ptr); } + void Deallocate(const void *Ptr) { free(const_cast(Ptr)); } void PrintStats() const {} }; @@ -80,9 +80,8 @@ public: unsigned EltSize = (sizeof(T)+Alignment-1)&~Alignment; return static_cast(Allocate(Num * EltSize, Alignment)); } - - - void Deallocate(void * /*Ptr*/) {} + + void Deallocate(const void * /*Ptr*/) {} void PrintStats() const; };