mirror of
https://github.com/gperftools/gperftools
synced 2025-02-27 01:20:28 +00:00
Changing internal behaviour of tcmalloc to return an allocated size of 0 when the target pointer is null (refer to TCMallocImplementation::GetAllocatedSize). This change was reviewed as https://codereview.appspot.com/5833050/.
git-svn-id: http://gperftools.googlecode.com/svn/trunk@149 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
This commit is contained in:
parent
9be2f8d802
commit
bafd0f8b7c
@ -1468,6 +1468,8 @@ void* cpp_memalign(size_t align, size_t size) {
|
||||
|
||||
// As promised, the definition of this function, declared above.
|
||||
size_t TCMallocImplementation::GetAllocatedSize(const void* ptr) {
|
||||
if (ptr == NULL)
|
||||
return 0;
|
||||
ASSERT(TCMallocImplementation::GetOwnership(ptr)
|
||||
!= TCMallocImplementation::kNotOwned);
|
||||
return GetSizeWithCallback(ptr, &InvalidGetAllocatedSize);
|
||||
|
Loading…
Reference in New Issue
Block a user