Skip to content

Conversation

@addaleax
Copy link
Member

@addaleaxaddaleax commented Dec 1, 2019

This addresses a TODO comment.


src: port memory-tracking allocator from QUIC repo

This implements a memory-tracking allocator that can be used to
provide memory allocation facilities to several thread-safe C
libraries, including nghttp2, nghttp3, ngtcp3 and uvwasi.

Refs: https://github.com/nodejs/quic/blob/34ee0bc96f804c73cb22b2945a1a78f780938492/src/node_mem.h
Co-authored-by: @jasnell

http2: use shared memory tracking implementation

The extensive testing done on http2 makes it easier to make sure
the implementation is correct (and doesn’t diverge unnecessarily).

Refs: nodejs/quic#126
Reviewed-By: @danbev
Reviewed-By: @jasnell

http2: track nghttp2-allocated memory in heap snapshot

WIP [upstream PR is open]

See nodejs/uvwasi#60

deps: update uvwasi

wasi: use memory-tracking allocator

This:

  • Protects against memory leaks in uvwasi.
  • Allows tracking the allocated memory in heap dumps.
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@addaleaxaddaleax requested a review from cjihrigDecember 1, 2019 01:11
@nodejs-github-botnodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Dec 1, 2019
@addaleaxaddaleax added c++ Issues and PRs that require attention from people who are familiar with C++. http2 Issues or PRs related to the http2 subsystem. wasi Issues and PRs related to the WebAssembly System Interface. labels Dec 1, 2019
addaleaxand others added 5 commits December 1, 2019 03:06
This implements a memory-tracking allocator that can be used to provide memory allocation facilities to several thread-safe C libraries, including nghttp2, nghttp3, ngtcp3 and uvwasi. Refs: https://github.com/nodejs/quic/blob/34ee0bc96f804c73cb22b2945a1a78f780938492/src/node_mem.h Co-authored-by: James M Snell <[email protected]>
The extensive testing done on http2 makes it easier to make sure the implementation is correct (and doesn’t diverge unnecessarily). Refs: nodejs/quic#126 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]>
This: - Protects against memory leaks in uvwasi. - Allows tracking the allocated memory in heap dumps.
@addaleax
Copy link
MemberAuthor

Rebased to include a full update of uvwasi to its current master branch, rather than cherry-pick only my upstream PR.

@nodejs-github-bot
Copy link
Collaborator

@addaleaxaddaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 4, 2019
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@joaocgreis
Copy link
Member

@addaleax
Copy link
MemberAuthor

Landed in 4e11920...a9abc17

addaleax added a commit that referenced this pull request Dec 7, 2019
This implements a memory-tracking allocator that can be used to provide memory allocation facilities to several thread-safe C libraries, including nghttp2, nghttp3, ngtcp3 and uvwasi. Refs: https://github.com/nodejs/quic/blob/34ee0bc96f804c73cb22b2945a1a78f780938492/src/node_mem.h Co-authored-by: James M Snell <[email protected]> PR-URL: #30745 Refs: nodejs/quic#126 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
addaleax added a commit that referenced this pull request Dec 7, 2019
The extensive testing done on http2 makes it easier to make sure the implementation is correct (and doesn’t diverge unnecessarily). Refs: nodejs/quic#126 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]> PR-URL: #30745 Refs: https://github.com/nodejs/quic/blob/34ee0bc96f804c73cb22b2945a1a78f780938492/src/node_mem.h Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]>
addaleax added a commit that referenced this pull request Dec 7, 2019
addaleax added a commit that referenced this pull request Dec 7, 2019
This: - Protects against memory leaks in uvwasi. - Allows tracking the allocated memory in heap dumps. PR-URL: #30745 Refs: https://github.com/nodejs/quic/blob/34ee0bc96f804c73cb22b2945a1a78f780938492/src/node_mem.h Refs: nodejs/quic#126 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]>
@addaleaxaddaleax closed this Dec 7, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.c++Issues and PRs that require attention from people who are familiar with C++.http2Issues or PRs related to the http2 subsystem.lib / srcIssues and PRs related to general changes in the lib or src directory.wasiIssues and PRs related to the WebAssembly System Interface.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@addaleax@nodejs-github-bot@joaocgreis@jasnell@Trott@cjihrig@gengjiawen@lundibundi