Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove a memory leak in bun.String.concat/createFromConcat #18084

Merged
merged 2 commits into from
Mar 12, 2025

Conversation

paperclover
Copy link
Member

the function bun.String.createFromConcat and bun.String.concat have a memory leak, and make too many allocations. since there is exactly one usage of this function, the easiest solution is to just delete it.

@robobun
Copy link

robobun commented Mar 11, 2025

Updated 5:47 PM PT - Mar 11th, 2025

@paperclover, your commit 2e95c2dae8799e7f858d04a25814e429d12c88bb passed in Build #13038! 🎉


🧪   try this PR locally:

bunx bun-pr 18084

@paperclover paperclover requested a review from DonIsaac March 11, 2025 23:40
const prefix = "http://";
const url_str = switch (input.is8Bit()) {
inline else => |is_8_bit| with_prefix: {
const enc: bun.String.WTFEncoding = if (is_8_bit) .latin1 else .utf16;
Copy link
Contributor

Choose a reason for hiding this comment

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

could/should this be a bun.String method?

@Jarred-Sumner Jarred-Sumner merged commit 832cf91 into main Mar 12, 2025
70 checks passed
@Jarred-Sumner Jarred-Sumner deleted the chloe/string-concat branch March 12, 2025 03:30
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.

4 participants