4

我在内存受限的 x64 系统中,我需要在内存中保存大量数据。使用这种数据结构有什么缺点。

struct entity
{
  unsigned int hash : 26;
  unsigned int timestamp : 14; 
} __attribute__ ((__packed__));

我知道不鼓励使用位字段,但是使用这种非对齐数据结构的最大缺点是什么。

该结构将用于内存存储,预计会出现一些性能下降。

4

1 回答 1

10

缺点(非详尽列表):

于 2012-05-24T15:49:45.853 回答