Deallocate() methods now take a 'const void*' instead of a 'void *', matching observe...
authorTed Kremenek <kremenek@apple.com>
Fri, 6 Feb 2009 19:34:14 +0000 (19:34 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 6 Feb 2009 19:34:14 +0000 (19:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63956 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Allocator.h

index 97c6d187a72297f2115317380925f3fe61f3fc5f..f0c713af86d9ea6583a5dde98540e79e60521e2f 100644 (file)
@@ -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;
 };