Uploaded image for project: 'Swift'
  1. Swift
  2. SR-10028

one single 'handler as? _ChannelOutboundHandler' allocates 144 times, every time it's executed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: None
    • Labels:

      Description

      I've got this simple program using NIO

      import NIO
      import NIOHTTP1
      
      @inline(never)
      public func blackhole(_ x: _ChannelOutboundHandler) {}
      
      @inline(never)
      func foo(handler: ChannelHandler) -> _ChannelOutboundHandler? {
          return handler as? _ChannelOutboundHandler
      }
      
      let h = ByteToMessageHandler(HTTPResponseDecoder())
      
      for f in 0..<10_000 {
          blackhole(foo(handler: h)!)
      }
      

      with our new HTTP parser which uses conditional conformances. I wouldn't expect this program to allocate at all in the loop because the only thing executed is

      handler as? _ChannelOutboundHandler
      

      but in actual fact, it allocates 144 times per execution of the loop.

      Repro:

      • download the attached repro.tar.gz
      • unpack
      • run
        swift build -c release && sudo dtrace -n '::BEGIN { mcalls = 0; } pid$target::malloc:entry { @ms[ustack()] = count(); mcalls += 1; } ::END { printa(@ms); printf("==========\ntotal malloc calls: %d\n", mcalls); }' -c ./.build/x86_64-apple-macosx/release/swiftslow
        

      output:

      // [...] MANY MORE OF THESE BLOCKS, too many for this JIRA issue
      
                    libsystem_malloc.dylib`malloc
                    libc++abi.dylib`operator new(unsigned long)+0x28
                    libswiftCore.dylib`std::__1::__hash_table<std::__1::__hash_value_type<(anonymous namespace)::SubstitutionEntry, unsigned int>, std::__1::__unordered_map_hasher<(anonymous namespace)::SubstitutionEntry, std::__1::__hash_value_type<(anonymous namespace)::SubstitutionEntry, unsigned int>, (anonymous namespace)::SubstitutionEntry::Hasher, true>, std::__1::__unordered_map_equal<(anonymous namespace)::SubstitutionEntry, std::__1::__hash_value_type<(anonymous namespace)::SubstitutionEntry, unsigned int>, std::__1::equal_to<(anonymous namespace)::SubstitutionEntry>, true>, std::__1::allocator<std::__1::__hash_value_type<(anonymous namespace)::SubstitutionEntry, unsigned int> > >::__rehash(unsigned long)+0x36
                    libswiftCore.dylib`(anonymous namespace)::Remangler::addSubstitution((anonymous namespace)::SubstitutionEntry const&)+0x29a
                    libswiftCore.dylib`(anonymous namespace)::Remangler::mangleAnyNominalType(swift::Demangle::Node*)+0x307
                    libswiftCore.dylib`swift::Demangle::mangleNode(swift::Demangle::Node* const&, llvm::function_ref<swift::Demangle::Node* (swift::Demangle::SymbolicReferenceKind, void const*)>)+0x118
                    libswiftCore.dylib`_findNominalTypeDescriptor(swift::Demangle::Node*, swift::Demangle::Demangler&)+0x6c
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledNominalType(swift::Demangle::Node*, swift::TargetContextDescriptor<swift::InProcess> const*&, swift::TargetMetadata<swift::InProcess> const*&)+0xb9
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0xac8
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0xac
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0x78f
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0xac
                    libswiftCore.dylib`swift_getTypeByMangledNodeImpl(swift::Demangle::Demangler&, swift::Demangle::Node*, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x179
                    libswiftCore.dylib`swift::swift_getTypeByMangledNode(swift::Demangle::Demangler&, swift::Demangle::Node*, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x1b6
                    libswiftCore.dylib`swift_getTypeByMangledNameImpl(llvm::StringRef, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x3f9
                    libswiftCore.dylib`swift::swift_getTypeByMangledName(llvm::StringRef, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x1b6
                    libswiftCore.dylib`swift::_checkGenericRequirements(llvm::ArrayRef<swift::TargetGenericRequirementDescriptor<swift::InProcess> >, std::__1::vector<void const*, std::__1::allocator<void const*> >&, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x36e
                    libswiftCore.dylib`swift::TargetProtocolConformanceDescriptor<swift::InProcess>::getWitnessTable(swift::TargetMetadata<swift::InProcess> const*) const+0x21a
                    libswiftCore.dylib`swift::_conformsToProtocol(swift::OpaqueValue const*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolDescriptorRef<swift::InProcess>, swift::TargetWitnessTable<swift::InProcess> const**)+0x2a
                    libswiftCore.dylib`swift::_checkGenericRequirements(llvm::ArrayRef<swift::TargetGenericRequirementDescriptor<swift::InProcess> >, std::__1::vector<void const*, std::__1::allocator<void const*> >&, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x486
                  40000
      
                    libsystem_malloc.dylib`malloc
                    libc++abi.dylib`operator new(unsigned long)+0x28
                    libswiftCore.dylib`void std::__1::vector<swift::Mangle::SubstitutionWord, std::__1::allocator<swift::Mangle::SubstitutionWord> >::__push_back_slow_path<swift::Mangle::SubstitutionWord>(swift::Mangle::SubstitutionWord&&)+0x9d
                    libswiftCore.dylib`void swift::Mangle::mangleIdentifier<(anonymous namespace)::Remangler>((anonymous namespace)::Remangler&, llvm::StringRef)+0x389
                    libswiftCore.dylib`(anonymous namespace)::Remangler::mangle(swift::Demangle::Node*)+0x2e5a
                    libswiftCore.dylib`(anonymous namespace)::Remangler::mangleAnyNominalType(swift::Demangle::Node*)+0x2dc
                    libswiftCore.dylib`swift::Demangle::mangleNode(swift::Demangle::Node* const&, llvm::function_ref<swift::Demangle::Node* (swift::Demangle::SymbolicReferenceKind, void const*)>)+0x118
                    libswiftCore.dylib`_findNominalTypeDescriptor(swift::Demangle::Node*, swift::Demangle::Demangler&)+0x6c
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledNominalType(swift::Demangle::Node*, swift::TargetContextDescriptor<swift::InProcess> const*&, swift::TargetMetadata<swift::InProcess> const*&)+0xb9
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0x73c
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0xac
                    libswiftCore.dylib`swift_getTypeByMangledNodeImpl(swift::Demangle::Demangler&, swift::Demangle::Node*, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x179
                    libswiftCore.dylib`swift::swift_getTypeByMangledNode(swift::Demangle::Demangler&, swift::Demangle::Node*, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x1b6
                    libswiftCore.dylib`swift_getTypeByMangledNameImpl(llvm::StringRef, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x3f9
                    libswiftCore.dylib`swift::swift_getTypeByMangledName(llvm::StringRef, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x1b6
                    libswiftCore.dylib`swift::_checkGenericRequirements(llvm::ArrayRef<swift::TargetGenericRequirementDescriptor<swift::InProcess> >, std::__1::vector<void const*, std::__1::allocator<void const*> >&, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x36e
                    libswiftCore.dylib`swift::TargetProtocolConformanceDescriptor<swift::InProcess>::getWitnessTable(swift::TargetMetadata<swift::InProcess> const*) const+0x21a
                    libswiftCore.dylib`swift::_conformsToProtocol(swift::OpaqueValue const*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolDescriptorRef<swift::InProcess>, swift::TargetWitnessTable<swift::InProcess> const**)+0x2a
                    libswiftCore.dylib`swift::_checkGenericRequirements(llvm::ArrayRef<swift::TargetGenericRequirementDescriptor<swift::InProcess> >, std::__1::vector<void const*, std::__1::allocator<void const*> >&, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x486
                    libswiftCore.dylib`swift::TargetProtocolConformanceDescriptor<swift::InProcess>::getWitnessTable(swift::TargetMetadata<swift::InProcess> const*) const+0x21a
                  40000
      
                    libsystem_malloc.dylib`malloc
                    libc++abi.dylib`operator new(unsigned long)+0x28
                    libswiftCore.dylib`void std::__1::vector<swift::TargetMetadata<swift::InProcess> const*, std::__1::allocator<swift::TargetMetadata<swift::InProcess> const*> >::__push_back_slow_path<swift::TargetMetadata<swift::InProcess> const* const&>(swift::TargetMetadata<swift::InProcess> const* const&&&)+0x9e
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0x7bf
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0xac
                    libswiftCore.dylib`swift_getTypeByMangledNodeImpl(swift::Demangle::Demangler&, swift::Demangle::Node*, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x179
                    libswiftCore.dylib`swift::swift_getTypeByMangledNode(swift::Demangle::Demangler&, swift::Demangle::Node*, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x1b6
                    libswiftCore.dylib`swift_getTypeByMangledNameImpl(llvm::StringRef, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x3f9
                    libswiftCore.dylib`swift::swift_getTypeByMangledName(llvm::StringRef, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x1b6
                    libswiftCore.dylib`swift::_checkGenericRequirements(llvm::ArrayRef<swift::TargetGenericRequirementDescriptor<swift::InProcess> >, std::__1::vector<void const*, std::__1::allocator<void const*> >&, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x36e
                    libswiftCore.dylib`swift::TargetProtocolConformanceDescriptor<swift::InProcess>::getWitnessTable(swift::TargetMetadata<swift::InProcess> const*) const+0x21a
                    libswiftCore.dylib`swift::_conformsToProtocol(swift::OpaqueValue const*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolDescriptorRef<swift::InProcess>, swift::TargetWitnessTable<swift::InProcess> const**)+0x2a
                    libswiftCore.dylib`swift::_checkGenericRequirements(llvm::ArrayRef<swift::TargetGenericRequirementDescriptor<swift::InProcess> >, std::__1::vector<void const*, std::__1::allocator<void const*> >&, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x486
                    libswiftCore.dylib`swift::TargetProtocolConformanceDescriptor<swift::InProcess>::getWitnessTable(swift::TargetMetadata<swift::InProcess> const*) const+0x21a
                    swiftslow`foo(handler:)+0x21
                    swiftslow`main+0xac
                    libdyld.dylib`start+0x1
                    swiftslow`0x1
                  40000
      
                    libsystem_malloc.dylib`malloc
                    libswiftCore.dylib`swift::Demangle::Demangler::init(llvm::StringRef)+0x59
                    libswiftCore.dylib`swift::Demangle::Demangler::demangleType(llvm::StringRef)+0x12
                    libswiftCore.dylib`swift_getTypeByMangledNameImpl(llvm::StringRef, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x25f
                    libswiftCore.dylib`swift::swift_getTypeByMangledName(llvm::StringRef, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x1b6
                    libswiftCore.dylib`swift::_checkGenericRequirements(llvm::ArrayRef<swift::TargetGenericRequirementDescriptor<swift::InProcess> >, std::__1::vector<void const*, std::__1::allocator<void const*> >&, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x120
                    libswiftCore.dylib`(anonymous namespace)::DecodedMetadataBuilder::createBoundGenericType(swift::TargetContextDescriptor<swift::InProcess> const*, llvm::ArrayRef<swift::TargetMetadata<swift::InProcess> const*>, swift::TargetMetadata<swift::InProcess> const*) const+0x293
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0xd70
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0xac
                    libswiftCore.dylib`swift_getTypeByMangledNodeImpl(swift::Demangle::Demangler&, swift::Demangle::Node*, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x179
                    libswiftCore.dylib`swift::swift_getTypeByMangledNode(swift::Demangle::Demangler&, swift::Demangle::Node*, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x1b6
                    libswiftCore.dylib`swift_getTypeByMangledNameImpl(llvm::StringRef, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x3f9
                    libswiftCore.dylib`swift::swift_getTypeByMangledName(llvm::StringRef, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x1b6
                    libswiftCore.dylib`swift::_checkGenericRequirements(llvm::ArrayRef<swift::TargetGenericRequirementDescriptor<swift::InProcess> >, std::__1::vector<void const*, std::__1::allocator<void const*> >&, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x36e
                    libswiftCore.dylib`swift::TargetProtocolConformanceDescriptor<swift::InProcess>::getWitnessTable(swift::TargetMetadata<swift::InProcess> const*) const+0x21a
                    libswiftCore.dylib`swift::_conformsToProtocol(swift::OpaqueValue const*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolDescriptorRef<swift::InProcess>, swift::TargetWitnessTable<swift::InProcess> const**)+0x2a
                    libswiftCore.dylib`swift::_checkGenericRequirements(llvm::ArrayRef<swift::TargetGenericRequirementDescriptor<swift::InProcess> >, std::__1::vector<void const*, std::__1::allocator<void const*> >&, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x486
                    libswiftCore.dylib`swift::TargetProtocolConformanceDescriptor<swift::InProcess>::getWitnessTable(swift::TargetMetadata<swift::InProcess> const*) const+0x21a
                    swiftslow`foo(handler:)+0x21
                    swiftslow`main+0xac
                  40000
      
                    libsystem_malloc.dylib`malloc
                    libc++abi.dylib`operator new(unsigned long)+0x28
                    libswiftCore.dylib`(anonymous namespace)::Remangler::addSubstitution((anonymous namespace)::SubstitutionEntry const&)+0x14a
                    libswiftCore.dylib`(anonymous namespace)::Remangler::mangle(swift::Demangle::Node*)+0x2e66
                    libswiftCore.dylib`(anonymous namespace)::Remangler::mangleAnyNominalType(swift::Demangle::Node*)+0x27c
                    libswiftCore.dylib`swift::Demangle::mangleNode(swift::Demangle::Node* const&, llvm::function_ref<swift::Demangle::Node* (swift::Demangle::SymbolicReferenceKind, void const*)>)+0x118
                    libswiftCore.dylib`_findNominalTypeDescriptor(swift::Demangle::Node*, swift::Demangle::Demangler&)+0x6c
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledNominalType(swift::Demangle::Node*, swift::TargetContextDescriptor<swift::InProcess> const*&, swift::TargetMetadata<swift::InProcess> const*&)+0xb9
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0xac8
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0xac
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0x78f
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0xac
                    libswiftCore.dylib`swift_getTypeByMangledNodeImpl(swift::Demangle::Demangler&, swift::Demangle::Node*, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x179
                    libswiftCore.dylib`swift::swift_getTypeByMangledNode(swift::Demangle::Demangler&, swift::Demangle::Node*, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x1b6
                    libswiftCore.dylib`swift_getTypeByMangledNameImpl(llvm::StringRef, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x3f9
                    libswiftCore.dylib`swift::swift_getTypeByMangledName(llvm::StringRef, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x1b6
                    libswiftCore.dylib`swift::_checkGenericRequirements(llvm::ArrayRef<swift::TargetGenericRequirementDescriptor<swift::InProcess> >, std::__1::vector<void const*, std::__1::allocator<void const*> >&, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x36e
                    libswiftCore.dylib`swift::TargetProtocolConformanceDescriptor<swift::InProcess>::getWitnessTable(swift::TargetMetadata<swift::InProcess> const*) const+0x21a
                    libswiftCore.dylib`swift::_conformsToProtocol(swift::OpaqueValue const*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolDescriptorRef<swift::InProcess>, swift::TargetWitnessTable<swift::InProcess> const**)+0x2a
                    libswiftCore.dylib`swift::_checkGenericRequirements(llvm::ArrayRef<swift::TargetGenericRequirementDescriptor<swift::InProcess> >, std::__1::vector<void const*, std::__1::allocator<void const*> >&, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x486
                  60000
      
                    libsystem_malloc.dylib`malloc
                    libc++abi.dylib`operator new(unsigned long)+0x28
                    libswiftCore.dylib`void std::__1::vector<swift::Mangle::SubstitutionWord, std::__1::allocator<swift::Mangle::SubstitutionWord> >::__push_back_slow_path<swift::Mangle::SubstitutionWord>(swift::Mangle::SubstitutionWord&&)+0x9d
                    libswiftCore.dylib`void swift::Mangle::mangleIdentifier<(anonymous namespace)::Remangler>((anonymous namespace)::Remangler&, llvm::StringRef)+0x389
                    libswiftCore.dylib`(anonymous namespace)::Remangler::mangle(swift::Demangle::Node*)+0x2e5a
                    libswiftCore.dylib`(anonymous namespace)::Remangler::mangleAnyNominalType(swift::Demangle::Node*)+0x27c
                    libswiftCore.dylib`swift::Demangle::mangleNode(swift::Demangle::Node* const&, llvm::function_ref<swift::Demangle::Node* (swift::Demangle::SymbolicReferenceKind, void const*)>)+0x118
                    libswiftCore.dylib`_findNominalTypeDescriptor(swift::Demangle::Node*, swift::Demangle::Demangler&)+0x6c
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledNominalType(swift::Demangle::Node*, swift::TargetContextDescriptor<swift::InProcess> const*&, swift::TargetMetadata<swift::InProcess> const*&)+0xb9
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0xac8
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0xac
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0x78f
                    libswiftCore.dylib`swift::Demangle::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::Node* const&)+0xac
                    libswiftCore.dylib`swift_getTypeByMangledNodeImpl(swift::Demangle::Demangler&, swift::Demangle::Node*, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x179
                    libswiftCore.dylib`swift::swift_getTypeByMangledNode(swift::Demangle::Demangler&, swift::Demangle::Node*, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x1b6
                    libswiftCore.dylib`swift_getTypeByMangledNameImpl(llvm::StringRef, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x3f9
                    libswiftCore.dylib`swift::swift_getTypeByMangledName(llvm::StringRef, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x1b6
                    libswiftCore.dylib`swift::_checkGenericRequirements(llvm::ArrayRef<swift::TargetGenericRequirementDescriptor<swift::InProcess> >, std::__1::vector<void const*, std::__1::allocator<void const*> >&, std::__1::function<swift::TargetMetadata<swift::InProcess> const* (unsigned int, unsigned int)>, std::__1::function<swift::TargetWitnessTable<swift::InProcess> const* (swift::TargetMetadata<swift::InProcess> const*, unsigned int)>)+0x36e
                    libswiftCore.dylib`swift::TargetProtocolConformanceDescriptor<swift::InProcess>::getWitnessTable(swift::TargetMetadata<swift::InProcess> const*) const+0x21a
                    libswiftCore.dylib`swift::_conformsToProtocol(swift::OpaqueValue const*, swift::TargetMetadata<swift::InProcess> const*, swift::TargetProtocolDescriptorRef<swift::InProcess>, swift::TargetWitnessTable<swift::InProcess> const**)+0x2a
                  90000
      ==========
      total malloc calls: 1440330
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              eeckstein Erik Eckstein
              Reporter:
              jw Johannes Weiss
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: