There is no Swift or Objective-C in the xnu kernel, so the answer to the first question has to be "no". To the second question, Swift is generally safe against these bugs except (1) in the face of race conditions and (2) when the developer uses things that have "unsafe" in the name.