File tree Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -13,13 +13,6 @@ use crate::runtime::{objc_autoreleasePoolPop, objc_autoreleasePoolPush};
13
13
///
14
14
/// And this is not [`Sync`], since you can only autorelease a reference to a
15
15
/// 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
23
16
pub struct AutoreleasePool {
24
17
context : * mut c_void ,
25
18
}
Original file line number Diff line number Diff line change @@ -10,8 +10,18 @@ and safely fails if the object has been deallocated.
10
10
These utilities are not intended to provide a fully safe interface, but can be
11
11
useful when writing higher-level Rust wrappers for Objective-C code.
12
12
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
15
25
16
26
# Example
17
27
Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ impl Ownership for Shared {}
99
99
/// ```
100
100
#[ repr( transparent) ]
101
101
// 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
102
103
pub struct Id < T , O : Ownership = Owned > {
103
104
/// A pointer to the contained object. The pointer is always retained.
104
105
///
You can’t perform that action at this time.
0 commit comments