Deallocate() methods now take a 'const void*' instead of a 'void *', matching observed behavior with how 'delete[]' can be used.

llvm-svn: 63956
This commit is contained in:
Ted Kremenek 2009-02-06 19:34:14 +00:00
parent 1a5f04dc66
commit 474f20efe3
1 changed files with 3 additions and 4 deletions

View 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;
};