How to query the capacity of a `String` buffer?

the first thing that i tried was looking for a profiling tool that could do this automatically. unfortunately Instruments is macOS-only, and heaptrack just attributes everything to swift_slowAlloc, which isn’t very helpful from a profiling standpoint. i’ve been dealing with this problem since march.

hence, why i am trying to gather some manual statistics through hacky methods like self._guts._object.largeAddressBits.

i wish it were appreciated more just how hard swift development is when you are outside of the apple ecosystem. i know that memory profilers are the best way to debug this, the only reason i am asking is because those tools don’t work on my platform.

3 Likes