Skip to content

Commit bb78bca

Browse files
committed
Note source for ivars being guaranteed to be zero-initialized
1 parent 44ab9df commit bb78bca

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

crates/objc2/src/declare/ivar.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ pub(crate) mod private {
3030
//
3131
// Additionally, the type must be safe to drop even if zero-initialized.
3232
//
33-
// Note that while I couldn't find a reference on whether ivars are
34-
// zero-initialized or not, it has been true since the Objective-C version
35-
// shipped with Mac OS X 10.0 [link] and is generally what one would expect
36-
// coming from C. So I think it's a valid assumption to make!
33+
// Ivars are documented to be zero-initialized in [this section of the
34+
// Objective-C manual][obj-dynamically-created], and that has been true since
35+
// at least [the Objective-C version shipped with Mac OS X 10.0][objc4-208].
3736
//
38-
// [link]: https://github.com/apple-oss-distributions/objc4/blob/objc4-208/runtime/objc-class.m#L367
37+
// [obj-dynamically-created]: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithObjects/WorkingwithObjects.html#//apple_ref/doc/uid/TP40011210-CH4-SW7
38+
// [objc4-208]: https://github.com/apple-oss-distributions/objc4/blob/objc4-208/runtime/objc-class.m#L367
3939
pub unsafe trait InnerIvarType: private::Sealed + Encode {
4040
/// The type that an `Ivar` containing this will dereference to.
4141
///

0 commit comments

Comments
 (0)