Skip to content

v4.x: backport node::Malloc - #9733

Closed
addaleax wants to merge 3 commits into
nodejs:v4.x-stagingfrom
addaleax:fix-aix-malloc
Closed

v4.x: backport node::Malloc#9733
addaleax wants to merge 3 commits into
nodejs:v4.x-stagingfrom
addaleax:fix-aix-malloc

Conversation

@addaleax

Copy link
Copy Markdown
Member

Backport:

Fixes the AIX CI failures currently popping up on CI.

danbevand others added 3 commits November 22, 2016 07:27
This commit attempts to fix one of the items in
nodejs#4641, which was to remove a TODO
comment from env.h regarding the naming of the ares_task_t struct.
Also, the struct ares_task_list was renamed to node_ares_task_list
following the same reasoning that is does not belong to the c-ares API.
PR-URL: nodejs#7345
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
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.
Fixes: nodejs#7549
PR-URL: nodejs#7564
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Change `Malloc()/Calloc()` so that size zero does not return a null
pointer, consistent with prior behavior.
Fixes: nodejs#8571
PR-URL: nodejs#8572
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@keybase.io>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. v4.x labels Nov 22, 2016
@MylesBorins

Copy link
Copy Markdown
Contributor

@MylesBorins

Copy link
Copy Markdown
Contributor

landed in f6f0b38...62e83b3

@addaleax
addaleax deleted the fix-aix-malloc branch November 22, 2016 19:00
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++Issues and PRs that require attention from people who are familiar with C++.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@addaleax@MylesBorins@nodejs-github-bot@danbev@mhdawson@Trott