Crates.io | pi_atom |
lib.rs | pi_atom |
version | 0.2.6 |
source | src |
created_at | 2022-03-01 05:31:18.181262 |
updated_at | 2024-03-27 07:37:32.89685 |
description | The global thread safe atomic string pool reduces the memory occupation of the same string and is also used for HashMap keys |
homepage | |
repository | https://github.com/GaiaWorld/pi_atom |
max_upload_size | |
id | 541361 |
size | 13,630 |
全局的线程安全的原子字符串池,减少相同字符串的内存占用,也用于hashmap的键
如果全局该字符串最后一个引用被释放, 则该字符串会释放。
为了减少不停的创建和放入池的次数,高频单次的Atom,可以在应用层增加一个cache来缓冲Atom,定期检查引用计数来判断是否缓冲。