Uh oh!
There was an error while loading. Please reload this page.
fs: reduced duplicate code in fs.write() - #2947
Conversation
thefourtheye
commented
Sep 18, 2015
LGTM |
ronkorving
commented
Sep 18, 2015
Amusingly btw, the names for strWrapper and bufWrapper were reversed:
Anyway, that doesn't matter anymore as they've been unified now. |
thefourtheye
commented
Sep 18, 2015
vkurchatkin
commented
Sep 18, 2015
I think this was actually done on purpose to avoid polymorphism |
thefourtheye
commented
Sep 18, 2015
@vkurchatkin Could you please elaborate? |
mscdex
commented
Sep 18, 2015
@thefourtheye FWIW this blog post explains mono/poly/mega-morphism (how it relates to v8/JavaScript) pretty well. |
ajafff
commented
Sep 18, 2015
Correct me if I'm wrong: |
mscdex
commented
Sep 19, 2015
After looking at FSWrapReq, it looks like the function arguments are always the same types for a write operation, so I think @meinklaus is right here. |
ronkorving
commented
Oct 5, 2015
Any blockers? |
brendanashworth
commented
Oct 15, 2015
LGTM if the CI is happy. For the record, I don't even know if keeping a reference to the string is necessary ("external" strings? this isn't handled elsewhere afaik). |
ronkorving
commented
Oct 15, 2015
I don't know either to be honest. @trevnorris may know more on this. I don't see that as a blocker for this PR, but if we can get clarity on that, of course I can update the PR if needed. I wouldn't want to introduce risk though. |
trevnorris
commented
Oct 15, 2015
IIRC you had a fix like this before. LGTM. I'm the one who did it this way. Was b/c I was overly strict about where I placed that assignment. Wasn't actually needed. |
ronkorving
commented
Oct 16, 2015
In the previous PR it was about buffers, this time it's about a string (well, the conversation is). Are you saying I can remove |
trevnorris
commented
Oct 16, 2015
I'm on crack. Was referring to changing the location of As for maintaining a reference to the string, when the string is externalized a reference has to be kept. Since we used the external memory from the string object. So if the string is GC'd while the data is written it can blow up. |
ronkorving
commented
Oct 17, 2015
Got it, thanks. Sounds like we're all good then :) |
trevnorris
commented
Oct 17, 2015
Yup. LGTM |
ronkorving
commented
Oct 27, 2015
Looking forward to seeing it merged :) Anything I can do to speed that up? |
trevnorris
commented
Oct 27, 2015
Whoops. Sorry. Running CI to verify everything is fine: https://ci.nodejs.org/job/node-test-pull-request/627/ |
PR-URL: #2947 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
trevnorris
commented
Oct 27, 2015
Bugger. NM. Landed in c339fa3. Thanks much! |
jasnell
commented
Oct 27, 2015
@trevnorris@thefourtheye@vkurchatkin ... should this also go into v4.x? |
trevnorris
commented
Oct 27, 2015
@jasnell code cleanup, no bug fix but also no side-effects. might be useful to have if landing future patches in the same code in the future. |
PR-URL: #2947 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
jasnell
commented
Oct 28, 2015
Landed in v4.x-staging in fb3b848 |
PR-URL: nodejs#2947 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: #2947 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
No description provided.