A starter bug for someone who wants to dip their toes into the Swift compiler: 
SR-2875  Emit objc_allocWithZone(cls) instead of [cls allocWithZone:nil]
https://bugs.swift.org/browse/SR-2875

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.

I believe the code to change is getAllocObjectFormalType() and 
emitObjCAllocObjectCall() in swift/lib/IRGen/GenObjC.cpp.


Not interested in this bug? We have dozens of other bugs marked "StarterBug" 
that we expect to be suitable for someone who has not contributed to the Swift 
project before. You can see the list here:
https://bugs.swift.org/issues/?jql=status%20%3D%20Open%20AND%20labels%20%3D%20StarterBug%20AND%20assignee%20in%20(EMPTY)


-- 
Greg Parker     gpar...@apple.com     Runtime Wrangler


_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Reply via email to