when creating code cache, delete the CachedData (it's created with BufferNotOwned by default, so we're just deleting the structure we won't use anymore)
When using DesugaredInterfaceCompanionClassNameResolver, instantiate it statically, so we don't need to delete anything. We could even make this class static. Also changed it to const std::string& to avoid string copying. Overall, this was leaking 24 bytes per invocation.
Description
Fixes 2 minor memory leaks:
when creating code cache, delete the CachedData (it's created with BufferNotOwned by default, so we're just deleting the structure we won't use anymore)
When using DesugaredInterfaceCompanionClassNameResolver, instantiate it statically, so we don't need to delete anything. We could even make this class static. Also changed it to
const std::string&
to avoid string copying. Overall, this was leaking 24 bytes per invocation.