-
Notifications
You must be signed in to change notification settings - Fork 284
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
Is this posible/reachabe code? #2600
Comments
Yeap, I think it is a possible "non-positive amount", in that case, don't you think that we should provide a better error handling on the implementation? I mean, at least use I don't know, this is just a proposal because I don't know why we are dealing with invalid amount in this way. |
@juanarbol - makes sense to me! but throw an exception that carries the original |
Yeap, it is a better approach, I think that: if (amount < 0) {
return uv_err_name(amount);
} But amm... the free memory method is |
here is a recent PR which did a similar thing: you need to:
/cc @addaleax for a better suggestion! |
No, because the return type of |
Based on nodejs/help#2600 (comment) the condition (amount < 0) won't be possible.
Thanks for the support! I'm closing this issue now. |
Based on nodejs/help#2600 (comment) the condition (amount < 0) won't be possible. PR-URL: #32818 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
Based on nodejs/help#2600 (comment) the condition (amount < 0) won't be possible. PR-URL: #32818 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
Based on nodejs/help#2600 (comment) the condition (amount < 0) won't be possible. PR-URL: #32818 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
Based on nodejs/help#2600 (comment) the condition (amount < 0) won't be possible. PR-URL: #32818 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
Is it possible to have
amount < 0
? Based on libuv codebase (at least on LINUX), the free mem (also total mem) is taken from/proc/meminfo
, based on that, is it possible to have a negative amount?The text was updated successfully, but these errors were encountered: