Skip to content

Conversation

@nnethercote
Copy link
Contributor

Currently it crashes.

nnethercote and others added 2 commits August 18, 2022 10:45
- Add `is_singleton`, and change the test in `set_len` to use it,
  because it's more precise than testing for zero capacity. (Precise in
  the sense of protecting against the bad case of writing to static
  memory.)
- Remove several "Don't mutate the empty singleton!" checks before
  `set_len` calls, now that `set_len` is able to handle that itself.
- Add a private `set_len_non_singleton`, and use it in places where we
  know we're not dealing with the singleton (e.g. after calling
  `reserve(1)`), for ultra-efficiency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants