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

dgram: use Buffer.alloc(0) for zero-size buffers #8751

Closed
wants to merge 1 commit into from

Conversation

ChALkeR
Copy link
Member

@ChALkeR ChALkeR commented Sep 23, 2016

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

dgram

Description of change

There is no difference between Buffer.alloc(0) and Buffer.allocUnsafe(0), so there is no reason to confuse anyone reading the code with an additional call to allocUnsafe.

/cc @jasnell @addaleax

Upd: ow, I created a branch on this repo, will delete it after this merges.

There is no difference between alloc(0) and allocUnsafe(0), so there is
no reason to confuse anyone reading the code with an additional call to
allocUnsafe.
@ChALkeR ChALkeR added the dgram Issues and PRs related to the dgram subsystem / UDP. label Sep 23, 2016
@nodejs-github-bot nodejs-github-bot added the dgram Issues and PRs related to the dgram subsystem / UDP. label Sep 23, 2016
Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@imyller imyller left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

LGTM

@lpinca
Copy link
Member

lpinca commented Sep 28, 2016

LGTM

@jasnell
Copy link
Member

jasnell commented Sep 28, 2016

@imyller
Copy link
Member

imyller commented Oct 2, 2016

@jasnell jasnell self-assigned this Oct 6, 2016
jasnell pushed a commit that referenced this pull request Oct 6, 2016
There is no difference between alloc(0) and allocUnsafe(0), so there is
no reason to confuse anyone reading the code with an additional call to
allocUnsafe.

PR-URL: #8751
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ilkka Myller <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
@jasnell
Copy link
Member

jasnell commented Oct 6, 2016

Landed in 0f944ab. Thank you!

@MylesBorins
Copy link
Contributor

lts?

@jasnell
Copy link
Member

jasnell commented Oct 7, 2016

Yes, pulling this back makes sense.

@ChALkeR ChALkeR deleted the dgram-buffer-alloc branch October 7, 2016 12:27
jasnell pushed a commit that referenced this pull request Oct 10, 2016
There is no difference between alloc(0) and allocUnsafe(0), so there is
no reason to confuse anyone reading the code with an additional call to
allocUnsafe.

PR-URL: #8751
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ilkka Myller <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Fishrock123 pushed a commit that referenced this pull request Oct 11, 2016
There is no difference between alloc(0) and allocUnsafe(0), so there is
no reason to confuse anyone reading the code with an additional call to
allocUnsafe.

PR-URL: #8751
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ilkka Myller <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
@MylesBorins
Copy link
Contributor

@ChALkeR this is not landing cleanly on v4.x, would you be willing to manually backport?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dgram Issues and PRs related to the dgram subsystem / UDP.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants