Skip to content

Semantics of grow/unsafeGrow #36

@snoyberg

Description

@snoyberg

I'd like to clarify the semantics of grow and unsafeGrow, and hopefully update the documentation appropriately. From looking at the code for boxed, unboxed, and storable vectors, it seems that in all cases, grow/unsafeGrow will create a new mutable vector and leave the original mutable vector unchanged. The upshot would be that it would be valid to modify the original vector without affecting the new vector, and vice-versa. Two questions:

  1. Have I misread the code, and in fact that's not the way the current three vector types work?
  2. Do we want to codify this contract in the documentation as a promise for future behavior?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions