swift
34b17dd3 - [Distributed] Distributed remote ref should be as small as possible (#87449)

Commit
2 days ago
[Distributed] Distributed remote ref should be as small as possible (#87449) Because we guaranteed that one cannot access a distribted "remote" instance's state via type system, we can allocate the instance much smaller because we never access those user initialized fields. This way a remote distributed actor reference is always 128 bytes, this is because actors have special storage 12*8 bytes of PrivateData in addition to the 16 bytes object header. With this optimization, regardless how many fields an actor has, the remote ref always is the same size. resolves rdar://81825648 Used claude to generate a bunch of tests to check the sizes of actors etc, I think this is correct (and getting it wrong totally just crashes immediately anyway). Could use a review though, thank you! cc @mikeash @xedin
Author
Parents
Loading