Skip to content

Commit b9231a6

Browse files
Grammatical fixes + touch-ups to keep some docs inline with the guide
1 parent a987ba1 commit b9231a6

File tree

3 files changed

+34
-23
lines changed

3 files changed

+34
-23
lines changed

doc/contributing/investigating_native_memory_leak.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
# Investigating memory leaks with valgrind
1+
# Investigating memory leaks with Valgrind
22

33
A Node.js process may run out of memory due to excessive consumption of
44
native memory. Native Memory is memory which is not managed by the
55
V8 Garbage collector and is allocated either by the Node.js runtime, its
66
dependencies or native [addons](https://nodejs.org/docs/latest/api/n-api.html).
77

8-
This guide provides information on how to use valgrind to investigate these
8+
This guide provides information on how to use Valgrind to investigate these
99
issues on Linux platforms.
1010

11-
## valgrind
11+
## Valgrind
1212

1313
[Valgrind](https://valgrind.org/docs/manual/quick-start.html) is a
1414
tool available on Linux distributions which can be used to investigate
1515
memory usage including identifying memory leaks (memory which is
1616
allocated and not freed) and other memory related problems
1717
like double freeing memory.
1818

19-
To use valgrind:
19+
To use Valgrind:
2020

21-
* Be patient, running under valgrind slows execution significantly
21+
* Be patient, running under Valgrind slows execution significantly
2222
due to the checks being performed.
2323
* Reduce your test case to the smallest reproduce. Due to the slowdown it is
2424
important to run the minimum test case in order to be able to do it in
@@ -35,7 +35,7 @@ apt-get install valgrind
3535

3636
## Invocation
3737

38-
The simplest invocation of valgrind is:
38+
The simplest invocation of Valgrind is:
3939

4040
```console
4141
valgrind node test.js
@@ -317,7 +317,7 @@ From the stack trace we can tell that the leak came from a native addon:
317317
318318
What we can't tell is where in the native addon the memory is being
319319
allocated. This is because by default the addon is compiled without
320-
the debug symbols which valgrind needs to be able to provide more
320+
the debug symbols which Valgrind needs to be able to provide more
321321
information.
322322

323323
## Enabling debug symbols to get more information
@@ -345,7 +345,7 @@ npm install --debug
345345
npm rebuild
346346
```
347347

348-
The next step is to run valgrind after the rebuild. This time the information
348+
The next step is to run Valgrind after the rebuild. This time the information
349349
for the leaking location includes the name of the source file and the
350350
line number:
351351

@@ -409,7 +409,7 @@ its symbols using `-rdynamic` so that they can be used by addons. If the stack
409409
gives you enough information to track down where the leak is, that's great,
410410
otherwise the next step is to compile a debug build of Node.js.
411411
412-
To get additional information with valgrind:
412+
To get additional information with Valgrind:
413413
414414
* Check out the Node.js source corresponding to the release that you
415415
want to debug. For example:
@@ -432,7 +432,7 @@ make -j4
432432
`./configure --debug`, two binaries will have been built when `make` was run.
433433
You must use the one which is in `out/Debug`.
434434
435-
Running valgrind using the debug build of Node.js shows:
435+
Running Valgrind using the debug build of Node.js shows:
436436
437437
```console
438438
==44112== 592 bytes in 1 blocks are possibly lost in loss record 26 of 27

doc/contributing/maintaining-the-build-files.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ There are three main build files that may be directly run when building Node.js:
1313
create platform-dependent build files. Its output is usually in one of these
1414
formats: Makefile, MSbuild, ninja, or XCode project files (the main
1515
Makefile mentioned below is maintained separately by humans). For a detailed
16-
guide on this script, see [configure](#configure).
16+
guide on this script, see [configure][].
1717
* `vcbuild.bat`: A Windows Batch Script that locates build tools, provides a
18-
subset of the targets available in the [Makefile](#makefile), and a few
18+
subset of the targets available in the [Makefile][], and a few
1919
targets of its own. For a detailed guide on this script, see
2020
[vcbuild.bat](#vcbuildbat).
2121
* `Makefile`: A Makefile that can be run with GNU Make. It provides a set of
2222
targets that build and test the Node.js binary, produce releases and
2323
documentation, and interact with the CI to run benchmarks or tests. For a
24-
detailed guide on this file, see [Makefile](#makefile).
24+
detailed guide on this file, see [Makefile][].
2525

26-
On Windows `vcbuild.bat` runs [configure](#configure) before building the
26+
On Windows `vcbuild.bat` runs [configure][] before building the
2727
Node.js binary, on other systems `configure` must be run manually before running
2828
`make` on the `Makefile`.
2929

@@ -58,3 +58,5 @@ maintained by humans. This is not usually run on Windows, where
5858
of this option.
5959

6060
[GYP]: https://gyp.gsrc.io/docs/UserDocumentation.md
61+
[Makefile]: #makefile
62+
[configure]: #configure

doc/contributing/maintaining-types-for-nodejs.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Maintaining types for Node.js
22

33
While JavaScript is an untyped language, there are a number of complementary
4-
technologies like [TypeScript](https://www.typescriptlang.org/) and
5-
[Flow](https://flow.org/) which allow developers to use types within their
4+
technologies like [TypeScript][] and
5+
[Flow][] which allow developers to use types within their
66
JavaScript projects. While many people don't use types, there are enough
77
who do that the project has agreed it's important to work towards having
8-
[suitable types for end-users](https://github.com/nodejs/node/blob/master/doc/contributing/technical-priorities.md#suitable-types-for-end-users).
8+
[suitable types for end-users][].
99

1010
## High level approach
1111

@@ -14,7 +14,7 @@ from shipping them with the Node.js runtime to having them be externally
1414
maintained.
1515

1616
The different options were discussed as part of the
17-
[next-10](https://github.com/nodejs/next-10/blob/main/meetings/summit-nov-2021.md#suitable-types-for-end-users)
17+
[next-10][]
1818
effort and it was agreed that maintaining them externally is the best approach.
1919
Some of the advantages to this approach include:
2020

@@ -34,22 +34,22 @@ The agreement was that the ideal flow would be as follows:
3434

3535
When you run `make doc` the canonical markdown files used to
3636
document the Node.js APIs in the
37-
[doc/api](https://github.com/nodejs/node/tree/master/doc/api)
37+
[doc/api][]
3838
directory are converted to both an `.html` file and a `.json` file.
3939

4040
As part of the regular build/release process both the `html` and
41-
`json` files are published to [nodejs.org](https://nodejs.org/en/docs/).
41+
`json` files are published to [nodejs.org][].
4242

4343
The generator that does the conversion is in the
44-
[tools/doc](https://github.com/nodejs/node/tree/master/tools/doc)
44+
[tools/doc][]
4545
directory.
4646

4747
## Markdown structure
4848

4949
The constraints required on the markdown files in the
50-
[doc/api](https://github.com/nodejs/node/tree/master/doc/api) directory
50+
[doc/api][] directory
5151
in order to be able to generate the JSON files are defined in the
52-
[documentation-style-guide](https://github.com/nodejs/node/blob/master/doc/README.md#documentation-style-guide).
52+
[documentation-style-guide][].
5353

5454
## Planned changes (as of Jan 1 2022)
5555

@@ -61,3 +61,12 @@ afterwards.
6161
There is an ongoing effort to add additional markdown constraints and
6262
then update the flow in order to be able to generate a better
6363
JSON output.
64+
65+
[doc/api]: https://github.com/nodejs/node/tree/master/doc/api
66+
[documentation-style-guide]: https://github.com/nodejs/node/blob/master/doc/README.md#documentation-style-guide
67+
[tools/doc]: https://github.com/nodejs/node/tree/master/tools/doc
68+
[nodejs.org]: https://nodejs.org/en/docs/
69+
[next-10]: https://github.com/nodejs/next-10/blob/main/meetings/summit-nov-2021.md#suitable-types-for-end-users
70+
[suitable types for end users]: https://github.com/nodejs/node/blob/master/doc/contributing/technical-priorities.md#suitable-types-for-end-users
71+
[Flow]: https://flow.org/
72+
[TypeScript]: https://www.typescriptlang.org/

0 commit comments

Comments
 (0)