In-place extension of arrays only for certain alignment?

Ali Çehreli acehreli at yahoo.com
Thu Aug 18 05:16:39 UTC 2022


On 8/17/22 19:27, Steven Schveighoffer wrote:
 > On 8/17/22 10:09 PM, Ali Çehreli wrote:
 >>  > IIRC, your data does not need to be sequential in *physical memory*,
 >>  > which means you can use a ring buffer that is segmented instead of
 >>  > virtually mapped, and that can be of any size.
 >>
 >> I thought about that as well. But I would like the sizes of blocks
 >> (Appenders?) be equal in size so that opIndex still can provide O(1)
 >> guarantee. (Compute the block + an offset.)
 >
 > It's still O(1). You only have 2 slices to worry about.

Sometimes 2... I wanted to leave the sliding window width dynamic.

So, there will be M buffers, not 2. If their lengths are not equal, 
opIndex must be O(M). M is expected to be small but still...

M buffers of 'pageSize - (meta data).sizeof' each.

BeerConf... Sure... :)

Ali



More information about the Digitalmars-d-learn mailing list