Efficiently allocating many short-lived small objects

前端 未结 3 896
有刺的猬
有刺的猬 2021-02-08 11:27

I\'ve got a small class (16 bytes on a 32bit system) which I need to dynamically allocate. In most cases the life-time of any given instance is very short. Some instances may al

3条回答
  •  無奈伤痛
    2021-02-08 11:51

    You might make sure that you are using the low fragmentation heap. It is on by default in Vista and later, but I do not think that is so with earlier OS's. That can make a big difference in allocation speed for small objects.

提交回复
热议问题