[llvm-commits] [llvm] r63956 - /llvm/trunk/include/llvm/Support/Allocator.h
Ted Kremenek
kremenek at apple.com
Fri Feb 6 11:34:14 PST 2009
Author: kremenek
Date: Fri Feb 6 13:34:14 2009
New Revision: 63956
URL: http://llvm.org/viewvc/llvm-project?rev=63956&view=rev
Log:
Deallocate() methods now take a 'const void*' instead of a 'void *', matching observed behavior with how 'delete[]' can be used.
Modified:
llvm/trunk/include/llvm/Support/Allocator.h
Modified: llvm/trunk/include/llvm/Support/Allocator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Allocator.h?rev=63956&r1=63955&r2=63956&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Allocator.h (original)
+++ llvm/trunk/include/llvm/Support/Allocator.h Fri Feb 6 13:34:14 2009
@@ -36,7 +36,7 @@
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 @@
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;
};
More information about the llvm-commits
mailing list