diff options
author | Rich Trott <rtrott@gmail.com> | 2021-10-11 07:55:04 +0300 |
---|---|---|
committer | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2021-10-20 12:59:11 +0300 |
commit | d0b58c0287e67a139137aa906819d95f8314b093 (patch) | |
tree | e9a92870138d89b608b1c6e6568611744c32c4f2 /doc/api/v8.md | |
parent | a7c17e08de658cbc0beefd8e9583803b5a62ac7e (diff) |
doc: format doc/api/*.md with markdown formatter
PR-URL: https://github.com/nodejs/node/pull/40403
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Diffstat (limited to 'doc/api/v8.md')
-rw-r--r-- | doc/api/v8.md | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/doc/api/v8.md b/doc/api/v8.md index d4972163cc6..4eb6aa6f902 100644 --- a/doc/api/v8.md +++ b/doc/api/v8.md @@ -12,6 +12,7 @@ const v8 = require('v8'); ``` ## `v8.cachedDataVersionTag()` + <!-- YAML added: v8.0.0 --> @@ -33,6 +34,7 @@ console.log(v8.cachedDataVersionTag()); // 183726201 ``` ## `v8.getHeapCodeStatistics()` + <!-- YAML added: v12.8.0 --> @@ -46,6 +48,7 @@ Returns an object with the following properties: * `external_script_source_size` {number} <!-- eslint-skip --> + ```js { code_and_metadata_size: 212208, @@ -55,6 +58,7 @@ Returns an object with the following properties: ``` ## `v8.getHeapSnapshot()` + <!-- YAML added: v11.13.0 --> @@ -75,6 +79,7 @@ stream.pipe(process.stdout); ``` ## `v8.getHeapSpaceStatistics()` + <!-- YAML added: v6.0.0 changes: @@ -83,7 +88,7 @@ changes: description: Support values exceeding the 32-bit unsigned integer range. --> -* Returns: {Object[]} +* Returns: {Object\[]} Returns statistics about the V8 heap spaces, i.e. the segments which make up the V8 heap. Neither the ordering of heap spaces, nor the availability of a @@ -140,6 +145,7 @@ The value returned is an array of objects containing the following properties: ``` ## `v8.getHeapStatistics()` + <!-- YAML added: v1.0.0 changes: @@ -174,15 +180,16 @@ garbage with a bit pattern. The RSS footprint (resident set size) gets bigger because it continuously touches all heap pages and that makes them less likely to get swapped out by the operating system. -`number_of_native_contexts` The value of native_context is the number of the +`number_of_native_contexts` The value of native\_context is the number of the top-level contexts currently active. Increase of this number over time indicates a memory leak. -`number_of_detached_contexts` The value of detached_context is the number +`number_of_detached_contexts` The value of detached\_context is the number of contexts that were detached and not yet garbage collected. This number being non-zero indicates a potential memory leak. <!-- eslint-skip --> + ```js { total_heap_size: 7326976, @@ -200,6 +207,7 @@ being non-zero indicates a potential memory leak. ``` ## `v8.setFlagsFromString(flags)` + <!-- YAML added: v1.0.0 --> @@ -256,6 +264,7 @@ When the process is about to exit, one last coverage will still be written to disk unless [`v8.stopCoverage()`][] is invoked before the process exits. ## `v8.writeHeapSnapshot([filename])` + <!-- YAML added: v11.13.0 --> @@ -316,6 +325,7 @@ The format is backward-compatible (i.e. safe to store to disk). Equal JavaScript values may result in different serialized output. ### `v8.serialize(value)` + <!-- YAML added: v8.0.0 --> @@ -326,6 +336,7 @@ added: v8.0.0 Uses a [`DefaultSerializer`][] to serialize `value` into a buffer. ### `v8.deserialize(buffer)` + <!-- YAML added: v8.0.0 --> @@ -336,11 +347,13 @@ Uses a [`DefaultDeserializer`][] with default options to read a JS value from a buffer. ### Class: `v8.Serializer` + <!-- YAML added: v8.0.0 --> #### `new Serializer()` + Creates a new `Serializer` object. #### `serializer.writeHeader()` @@ -447,6 +460,7 @@ Indicate whether to treat `TypedArray` and `DataView` objects as host objects, i.e. pass them to [`serializer._writeHostObject()`][]. ### Class: `v8.Deserializer` + <!-- YAML added: v8.0.0 --> @@ -495,7 +509,7 @@ For use inside of a custom [`deserializer._readHostObject()`][]. #### `deserializer.readUint64()` -* Returns: {integer[]} +* Returns: {integer\[]} Read a raw 64-bit unsigned integer and return it as an array `[hi, lo]` with two 32-bit unsigned integer entries. @@ -528,6 +542,7 @@ This method is not present on the `Deserializer` class itself but can be provided by subclasses. ### Class: `v8.DefaultSerializer` + <!-- YAML added: v8.0.0 --> @@ -537,6 +552,7 @@ A subclass of [`Serializer`][] that serializes `TypedArray` stores the part of their underlying `ArrayBuffer`s that they are referring to. ### Class: `v8.DefaultDeserializer` + <!-- YAML added: v8.0.0 --> |