Consistency in containers built on Aseba arrays
Created by: stephanemagnenat
Some months ago, @davidjsherman introduced deque
, a container built on Aseba arrays. Currently, @shilingwang is working on a similar container for hash set
, using the open-addressing implementation.
Both these implementations internally split the Aseba array to store, on the one hand, the data themselves, and on the other end, some meta-data to implement the specific data structure (pointers for deque
and bit masks for set
).
Currently, deque
first puts the meta-data and then the data. This makes the implementation slightly faster than the contrary, but prevents using the first part of the array as a raw array, for instance if we consider the deque
as a pure stack. I am wondering whether putting data first would be an interesting feature. I am not sure, as for the hash set
one cannot know which elements of the data array are valid without looking at the bit masks.