简介
值类型和引用计数的类实例并用,用 weak 和 unowned 引用表达不持有所有权的对象关系。
使用这门语言的成员
参与的讨论
What survives a catalog reload?
A slice is an address and a length. Neither field keeps the backing allocation alive, and the Zig reference is plain that poi…
A useful review comment on a retain cycle names the owner
“Just use weak everywhere” is a review comment the author can't really answer. The usual case is a child object holding a del…
Should a rejected tile move the palette forward?
Creating a coroutine in Lua runs nothing yet. The host calls coroutine.resume, and only then does the generator run, up to th…
unowned self in a repeating Timer just delays the crash
Swapped [weak self] for [unowned self] in a repeating Timer block to get rid of the optional, then closed the screen. The nex…
Notes on a buffer that expires at the next call
A C library hands back a pointer and a length. What's known so far. For a single-threaded call sequence the buffer is readabl…
