Skip to content

[cpyrt] Reuse InitializerListConverter element converters - #54

Merged
aaronj0 merged 1 commit into
compiler-research:mainfrom
aaronj0:reuse-initlist-converters
Aug 31, 2026
Merged

[cpyrt] Reuse InitializerListConverter element converters#54
aaronj0 merged 1 commit into
compiler-research:mainfrom
aaronj0:reuse-initlist-converters

Conversation

@aaronj0

@aaronj0 aaronj0 commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

SetArg() created an element converter per call and appended it to fConverters, but Clear() frees only fBuffer, so the vector grew without bound across repeated std::initializer_list conversions. Create each element converter once and reuse it.

Upstreamed from the ROOT migration

@guitargeek guitargeek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! I think we can unify this to a single "CreateConverter" path though

Comment thread src/cpyrt/Converters.cxx Outdated
Comment thread src/cpyrt/Converters.cxx Outdated
SetArg() created an element converter per call and appended it to
fConverters, but Clear() frees only fBuffer, so the vector grew without
bound across repeated std::initializer_list conversions. Create each
element converter once, on first use of its index, and reuse it.
@aaronj0
aaronj0 force-pushed the reuse-initlist-converters branch from e43a07c to 6951eb0 Compare August 31, 2026 17:58

@guitargeek guitargeek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@aaronj0
aaronj0 merged commit 6ac8260 into compiler-research:main Aug 31, 2026
9 checks passed
vgvassilev pushed a commit to vgvassilev/cppjit that referenced this pull request Sep 6, 2026
…esearch#54)

SetArg() created an element converter per call and appended it to
fConverters, but Clear() frees only fBuffer, so the vector grew without
bound across repeated std::initializer_list conversions. Create each
element converter once, on first use of its index, and reuse it.
aaronj0 added a commit to aaronj0/cppjit-compres that referenced this pull request Sep 6, 2026
…esearch#54)

SetArg() created an element converter per call and appended it to
fConverters, but Clear() frees only fBuffer, so the vector grew without
bound across repeated std::initializer_list conversions. Create each
element converter once, on first use of its index, and reuse it.
aaronj0 added a commit to aaronj0/cppjit-compres that referenced this pull request Sep 6, 2026
…esearch#54)

SetArg() created an element converter per call and appended it to
fConverters, but Clear() frees only fBuffer, so the vector grew without
bound across repeated std::initializer_list conversions. Create each
element converter once, on first use of its index, and reuse it.
aaronj0 added a commit to aaronj0/cppjit-compres that referenced this pull request Sep 6, 2026
…esearch#54)

SetArg() created an element converter per call and appended it to
fConverters, but Clear() frees only fBuffer, so the vector grew without
bound across repeated std::initializer_list conversions. Create each
element converter once, on first use of its index, and reuse it.
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