简体   繁体   English

Boost库中dynamic_bitset允许的最大大小

[英]Maximum size allowed for dynamic_bitset from boost library

I have a use case where I need to create a bit map with size 2^64-1. 我有一个用例,需要创建一个大小为2 ^ 64-1的位图。 After some reading and googling over on this topic, i have decided to use dynamic_bitset from the C++ boost library. 在阅读并仔细研究了该主题之后,我决定使用C ++ boost库中的dynamic_bitset。

Should I be concerned over the large size of bit map ? 我应该担心位图的大尺寸吗? I would like to get more thoughts on the performance impact for such a huge size on dynamic_bitset. 对于dynamic_bitset如此巨大的性能,我想对性能产生更多的影响。 Any other alternatives for dynamic_bitset with respect to this use case ? 关于此用例,dynamic_bitset是否有其他替代方法?

Thanks. 谢谢。

Actually, the size of dynamic_bitset is not limited by the library or by the c++ language itself but it is limited by your RAM size. 实际上, dynamic_bitset的大小不受库或c ++语言本身的限制,但受RAM大小的限制。 So, 2^64-1 bits is about 2,305,843,009,213,693,952 bytes, or 2,3 million terabytes. 因此, 2^64-1位约为2,305,843,009,213,693,952字节,或2,3百万兆字节。 I don't think that you have that much memory in your computer. 我认为您的计算机中没有那么多的内存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM