Skip to content

Instantly share code, notes, and snippets.

@Bashta
Created June 29, 2017 10:01
Show Gist options
  • Select an option

  • Save Bashta/af7cfbad1080cf8f6211b6c95aadfff3 to your computer and use it in GitHub Desktop.

Select an option

Save Bashta/af7cfbad1080cf8f6211b6c95aadfff3 to your computer and use it in GitHub Desktop.
let size = chacheDictionary.keys.reduce(0) { (result, key) -> Int in
return result + malloc_size(Unmanaged.passRetained(key as AnyObject).toOpaque()) + malloc_size(Unmanaged.passRetained(chacheDictionary[key] as AnyObject).toOpaque())
}
print(size)
//500bytes per obj in median.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment