Skip to content

doc: add Buffer.from(string) to functions that use buffer pool - #52801

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
Whitecx:update-buffer-pool-docs
Jun 14, 2024
Merged

doc: add Buffer.from(string) to functions that use buffer pool#52801
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
Whitecx:update-buffer-pool-docs

Conversation

@Whitecx

Copy link
Copy Markdown
Contributor

Buffer.from(string) is one of the functions that may use the pre-allocated buffer. It's mentioned in the description of Buffer.from(array), but not in Buffer.from(string), or in the two other places where functions that behave this way are listed, so this commit adds those references.

@nodejs-github-botnodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations. labels May 2, 2024
@jasnell

Copy link
Copy Markdown
Member

There appear to be a number of additional commits here that are unrelated to the doc change. Can I ask you to remove the extra commits?

@Whitecx
Whitecxforce-pushed the update-buffer-pool-docs branch from 7fdf253 to bf02a19CompareMay 5, 2024 20:58
@Whitecx

Copy link
Copy Markdown
ContributorAuthor

There appear to be a number of additional commits here that are unrelated to the doc change. Can I ask you to remove the extra commits?

Sorry about that, everything should be cleaned up now.

@Whitecx

Copy link
Copy Markdown
ContributorAuthor

@jasnell Does this change feel substantive? I wanted to make this PR when I had some time, because I'd used buffer.from(string) and was confused as to why the underlying buffer had other data in it. When I didn't see any explanation in the buffer.from(string) section of the docs, I actually went to the source code and found where the buffer pool was used when creating strings long before I noticed that this behavior was documented at the bottom of buffer.from(array) 😂.

It would've saved me some time had it been in the buffer.from(string) section of the docs, so I thought it might help others as well.

@Whitecx

Copy link
Copy Markdown
ContributorAuthor

If anyone has capacity to review this PR, I'd greatly appreciate it! If it doesn't seem worth including, I can certainly close it 🙂

Comment threaddoc/api/buffer.md Outdated
Comment threaddoc/api/buffer.md Outdated
@Whitecx
Whitecxforce-pushed the update-buffer-pool-docs branch 2 times, most recently from 95178d7 to 18263bdCompareJune 8, 2024 19:50
Comment threaddoc/api/buffer.md Outdated
@Whitecx
Whitecxforce-pushed the update-buffer-pool-docs branch from 18263bd to a439e5aCompareJune 8, 2024 22:52
H4ad
H4ad approved these changes Jun 8, 2024

@H4adH4ad left a comment

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.

Thanks for the changes!

@H4ad

H4ad commented Jun 8, 2024

Copy link
Copy Markdown
Member

Oh, sorry for asking one more thing but can you please change the commit message to use add instead of added, is just for the commit message conventions.

Buffer.from(string) is one of the functions that may use the
pre-allocated buffer. It's mentioned in the description of
Buffer.from(array), but not in Buffer.from(string), or in the two other
places where functions that behave this way are listed, so this commit
adds those references.
@Whitecx
Whitecxforce-pushed the update-buffer-pool-docs branch from a439e5a to 214da9eCompareJune 8, 2024 23:33
@WhitecxWhitecx changed the title doc: added Buffer.from(string) to functions that use buffer pooldoc: add Buffer.from(string) to functions that use buffer poolJun 8, 2024
@Whitecx

Copy link
Copy Markdown
ContributorAuthor

Oh, sorry for asking one more thing but can you please change the commit message to use add instead of added, is just for the commit message conventions.

No problem! I'll keep that in mind for future PRs 🙂

@Whitecx
Whitecx requested a review from H4adJune 13, 2024 19:01
@H4adH4ad added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 14, 2024
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 14, 2024
@nodejs-github-bot
nodejs-github-bot merged commit ee8e841 into nodejs:mainJun 14, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in ee8e841

@H4ad

H4ad commented Jun 14, 2024

Copy link
Copy Markdown
Member

@Whitecx congratulations on your first PR, thanks for contributing!

@Whitecx

Copy link
Copy Markdown
ContributorAuthor

@Whitecx congratulations on your first PR, thanks for contributing!

Thank you!! And thank you for supporting with your review 😊

targos pushed a commit that referenced this pull request Jun 20, 2024
Buffer.from(string) is one of the functions that may use the
pre-allocated buffer. It's mentioned in the description of
Buffer.from(array), but not in Buffer.from(string), or in the two other
places where functions that behave this way are listed, so this commit
adds those references.
PR-URL: #52801
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: James M Snell <jasnell@gmail.com>
soophoo pushed a commit to soophoo/node that referenced this pull request Jun 20, 2024
Buffer.from(string) is one of the functions that may use the
pre-allocated buffer. It's mentioned in the description of
Buffer.from(array), but not in Buffer.from(string), or in the two other
places where functions that behave this way are listed, so this commit
adds those references.
PR-URL: nodejs#52801
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: James M Snell <jasnell@gmail.com>
@targostargos mentioned this pull request Jun 25, 2024
marco-ippolito pushed a commit that referenced this pull request Jul 19, 2024
Buffer.from(string) is one of the functions that may use the
pre-allocated buffer. It's mentioned in the description of
Buffer.from(array), but not in Buffer.from(string), or in the two other
places where functions that behave this way are listed, so this commit
adds those references.
PR-URL: #52801
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: James M Snell <jasnell@gmail.com>
@marco-ippolitomarco-ippolito mentioned this pull request Jul 19, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bufferIssues and PRs related to the buffer subsystem.docIssues and PRs related to the documentations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Whitecx@jasnell@H4ad@nodejs-github-bot