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

core: normalize malloc, realloc #7564

Closed
wants to merge 2 commits into from
Closed

Commits on Sep 1, 2016

  1. core: normalize malloc, realloc

    malloc(0) and realloc(ptr, 0) have implementation-defined behavior in
    that the standard allows them to either return a unique pointer or a
    nullptr for zero-sized allocation requests.  Normalize by always using
    a nullptr.
    
    - Introduce node::malloc, node::realloc and node::calloc that should
      be used throught our source.
    - Update all existing node source files to use the new functions
      instead of the native allocation functions.
    mhdawson committed Sep 1, 2016
    Configuration menu
    Copy the full SHA
    e222876 View commit details
    Browse the repository at this point in the history
  2. crypto: make malloc failure check cross-platform

    `malloc(0)` may return NULL on some platforms. Do not report
    out-of-memory error unless `malloc` was passed a number greater than
    `0`.
    
    Fixes: nodejs#7564
    PR-URL: nodejs#8352
    Trott authored and mhdawson committed Sep 1, 2016
    Configuration menu
    Copy the full SHA
    7517bfe View commit details
    Browse the repository at this point in the history