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

Emit objc_allocWithZone(cls) instead of [cls allocWithZone:nil]

    XMLWordPrintable

    Details

      Description

      swiftc currently emits calls to `[cls allocWithZone:nil]` when constructing Objective-C objects. It should emit calls to `objc_allocWithZone(cls)` instead.

      `objc_allocWithZone()` is faster (it avoids a message send when there are no overrides in place) and is a smaller call site.

        Attachments

          Activity

            People

            Assignee:
            greg Greg Titus
            Reporter:
            gparker Greg Parker
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: