Saturday 15 August 2015

c++ - Cache efficient way to implement a list of a priori bounded size -


I have a list for which I have a priority set that is bound as a configuration option, it never Also, the n element will fill it up to N elements, and after that I only need to support the only operation, at the end of the list there is an element in the list is.

Ideally, I would like to have a data structure, where I have a list node that contains an indicator in the archived object. Since I know that the most N list nodes are, I can allocate them in memory so that the jump around the list is possibly a faster operation, because the elements in the list will probably become hot in the cache .

Does STL std :: list is possible to allocate your nodes in this way, that is, it can be done with a custom allocator (I have never done

before trying to write a custom allocation for an STL class.)

No comments:

Post a Comment