Skip to content

Commit b980a1f

Browse files
committed
Add a few more links to objc2::rc documentation
1 parent e6288e9 commit b980a1f

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

objc2/src/rc/autorelease.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ use crate::runtime::{objc_autoreleasePoolPop, objc_autoreleasePoolPush};
1313
///
1414
/// And this is not [`Sync`], since you can only autorelease a reference to a
1515
/// pool on the current thread.
16-
///
17-
/// See [the clang documentation][clang-arc] and [the apple article on memory
18-
/// management][memory-mgmt] for more information on automatic reference
19-
/// counting.
20-
///
21-
/// [clang-arc]: https://clang.llvm.org/docs/AutomaticReferenceCounting.html
22-
/// [memory-mgmt]: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/MemoryMgmt.html
2316
pub struct AutoreleasePool {
2417
context: *mut c_void,
2518
}

objc2/src/rc/mod.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,18 @@ and safely fails if the object has been deallocated.
1010
These utilities are not intended to provide a fully safe interface, but can be
1111
useful when writing higher-level Rust wrappers for Objective-C code.
1212
13-
For more information on Objective-C's reference counting, see Apple's documentation:
14-
<https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/MemoryMgmt.html>
13+
See [the clang documentation][clang-arc] and [the Apple article on memory
14+
management][mem-mgmt] (similar document exists [for Core Foundation][mem-cf])
15+
for more information on automatic and manual reference counting.
16+
17+
It can also be useful to [enable Malloc Debugging][mem-debug] if you're trying
18+
to figure out if/where your application has memory errors and leaks.
19+
20+
21+
[clang-arc]: https://clang.llvm.org/docs/AutomaticReferenceCounting.html
22+
[mem-mgmt]: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/MemoryMgmt.html
23+
[mem-cf]: https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/CFMemoryMgmt.html
24+
[mem-debug]: https://developer.apple.com/library/archive/documentation/Performance/Conceptual/ManagingMemory/Articles/MallocDebug.html
1525
1626
# Example
1727

objc2_id/src/id.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ impl Ownership for Shared {}
9999
/// ```
100100
#[repr(transparent)]
101101
// TODO: Figure out if `Message` bound on `T` would be better here?
102+
// TODO: Add `?Sized + ptr::Thin` bound on `T` to allow for extern types
102103
pub struct Id<T, O: Ownership = Owned> {
103104
/// A pointer to the contained object. The pointer is always retained.
104105
///

0 commit comments

Comments
 (0)