[swift-dev] Adding a field to StrongRefCount class

John McCall rjmccall at apple.com
Tue Sep 26 00:22:21 CDT 2017


> On Sep 26, 2017, at 12:56 AM, Jiho Choi via swift-dev <swift-dev at swift.org> wrote:
> I want to add a field to StrongRefCount class for some experiment, but the build fails while building self-hosted 'swift-build'.  I am using the version 3.1.1.
> 
> Does the shape of StrongRefCount class have any implicit dependence on other parts of the runtime?

The size of the heap header is hard-coded in the compiler.  There's a function getHeapHeaderSize in StructLayout.cpp, but you'll also need to update the definition of RefCountedStructTy in IRGenModule.cpp, and almost certainly some other places.  It's not something that's been carefully abstracted because it's something we don't really expect to change.

John.

> What is the correct way to add a field to this class?
> 
> Thanks,
> Jiho
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev



More information about the swift-dev mailing list