c - Calculate the number of bytes used by a CFStringRef / CFMutableArrayRef -


I am trying to track memory usage in my program, and use it for the array of string data Should know the total amount of storage.

My string is displayed as CF string reef, and my array is a CFM filter array.

In the string I get CFTringGetLength () to get the number of UTF 16 code pairs in the string but the Apple String Storage Guide tells that the string can be stored in more compressed formats [1] Suppose that A UTF16 is 2 bytes, it will definitely give me a conservative upper limit, which is a good start.

For the unstable array, I could assume that storage is the power of 2) size size (zero *).

What is the better way to calculate the size? Is there a function to get the allocated bytes for the item obtained from CFTEP?

If I do not believe this, I am planning to write a CFLocortor which proxies all calls to the real CFALOcter, but I am using it allocation.

[1]

You can use malloc_size () : //www.manpagez.com/man/3/malloc_size/) To get the size of the allocation for each object.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -