Open in app

Sign In

Write

Sign In

vitonzhang
vitonzhang

348 Followers

Home

About

Nov 3, 2021

This way of having inner reference types is an expensive operation that requires many calls to malloc/free and a significant reference counting overhead each time you copy.

Copy on Write in Swift
530
1

Nitin George

I have a test case for struct with inner reference type.

I have a test case for struct with inner reference type. The code and output is in the following gist: https://gist.github.com/vitonzhangtt/a89949daa92641b7ea55d4e2cbaca436 According to the output, I have a conclusion: The assignment operation of struct variables with inner reference type properties will not trigger malloc/free. I would like to hear your opinions about this.

1 min read

1 min read

vitonzhang

vitonzhang

348 Followers

Coder At Beijing. Maybe open a company in the next ten years.

Following
  • Noah

    Noah

  • JIN

    JIN

  • Vivek Kv

    Vivek Kv

  • Ananth Ramachandran

    Ananth Ramachandran

  • Guodong (Troy) Zhao

    Guodong (Troy) Zhao

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech