Skip to content

Is this posible/reachabe code? #2600

Closed
Closed
@juanarbol

Description

@juanarbol
  • Node.js Version: current
  • OS: any
  • Scope (install, code, runtime, meta, other?):
  • Module (and version) (if relevant): current
// src/node_os.cc:133
static void GetFreeMemory(const FunctionCallbackInfo<Value>& args) {
  double amount = uv_get_free_memory();
  if (amount < 0) // This
    return;
  args.GetReturnValue().Set(amount);
}

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions