Skip to content

unsafe set_len breaks fragmentation rules #58

@orxfun

Description

@orxfun

Assume we are using a Doubling strategy and currently we have 2 fragments with capacities of 4 an 8 respectively.
If the user calls set_len(3) while the vector is on this state, we will have:

  • fragment 1 with len=3 and capacity=4
  • fragment 2 with len=0 and capacity=8

This is an invalid fragment state. We must drop the second fragment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions