Skip to content

[mypyc] Refactor: use helper functions for vec growth#21361

Open
JukkaL wants to merge 2 commits intomasterfrom
vec-growth
Open

[mypyc] Refactor: use helper functions for vec growth#21361
JukkaL wants to merge 2 commits intomasterfrom
vec-growth

Conversation

@JukkaL
Copy link
Copy Markdown
Collaborator

@JukkaL JukkaL commented Apr 28, 2026

This way we can centrally manage the logic used to increase vec sizes during growth.

This way we can centrally manage the logic used to increase vec
sizes during growth.
Comment thread mypyc/lib-rt/vecs/librt_vecs.h Outdated
// Growth helpers

static inline Py_ssize_t Vec_GrowCapacity(Py_ssize_t cap) {
if (cap > (PY_SSIZE_T_MAX - 1) / 2) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe put unlikely() here and below?

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.

3 participants