[swift-dev] Statically-emitted or statically-allocated objects with new refcounting

Greg Parker gparker at apple.com
Tue Mar 14 15:52:54 CDT 2017


> On Mar 14, 2017, at 1:34 PM, Greg Parker via swift-dev <swift-dev at swift.org> wrote:
> 
> 
>> On Mar 14, 2017, at 12:43 PM, Joe Groff <jgroff at apple.com <mailto:jgroff at apple.com>> wrote:
>> 
>> Hey Greg, what are the correct refcounting bits now to set in a global statically-emitted heap object that shouldn't ever be released?
> 
> For now use the same thing that stack-allocated objects use. I forget what the bit pattern is exactly. (I assume you are not in strictly read-only memory and can tolerate writes to the refcount word. We don't yet have an implementation for immortal read-only objects.)

Oh wait, you *don't* want to use what stack-allocated objects use. They get deinited without being deallocated, and I assume you want neither deinit nor dealloc. Let me work this out.


-- 
Greg Parker     gparker at apple.com <mailto:gparker at apple.com>     Runtime Wrangler


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20170314/cc72d9c0/attachment.html>


More information about the swift-dev mailing list