Skip to content

Efficient use of devector as queue or stack. #299

@karl3wm

Description

@karl3wm

The current policy of devector is to move the data to the middle of the allocated region whenever capacity is needed on an end.

This results in half of the free capacity being wasted when only one end of the devector is used.

Instead, the policy for free capacity for the devector should be configurable separately for each end.

This would make it easy to provide configurations for contiguous queues.

Additionally, the functions to reserve capacity in the front or back always allocate if space is needed. Instead, if sufficient capacity per the policy is available on the other end, the data could be moved without the new allocation. This is most appropriate for queues which have need of capacity on only one end.

Avoiding problems like this would ideally be done by parameterizing the algorithmic choices of devector into general policies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions