r335372 - [NFC] Fix AttributeList allocated_size for ParsedType.

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 22 10:34:45 PDT 2018


Author: erichkeane
Date: Fri Jun 22 10:34:44 2018
New Revision: 335372

URL: http://llvm.org/viewvc/llvm-project?rev=335372&view=rev
Log:
[NFC] Fix AttributeList allocated_size for ParsedType.

This if/elseif structure seems to be missing this case.
Previously, this would report a size of 1 pointer too small. 
This didn't really change anything besides failing to reclaim
a very small amount of memory.

Modified:
    cfe/trunk/lib/Sema/AttributeList.cpp

Modified: cfe/trunk/lib/Sema/AttributeList.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AttributeList.cpp?rev=335372&r1=335371&r2=335372&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AttributeList.cpp (original)
+++ cfe/trunk/lib/Sema/AttributeList.cpp Fri Jun 22 10:34:44 2018
@@ -40,6 +40,8 @@ size_t AttributeList::allocated_size() c
     return AttributeFactory::TypeTagForDatatypeAllocSize;
   else if (IsProperty)
     return AttributeFactory::PropertyAllocSize;
+  else if (HasParsedType)
+    return sizeof(AttributeList) + sizeof(void *);
   return (sizeof(AttributeList) + NumArgs * sizeof(ArgsUnion));
 }
 




More information about the cfe-commits mailing list